Register the Whoops exception displayer.

@return void
13064
protected function registerDebugDisplayer()
	{
		$this->registerWhoops();

		$this->app['exception.debug'] = $this->app->share(function($app)
		{
			return new WhoopsDisplayer($app['whoops'], $app->runningInConsole());
		});
	}
765926
protected function registerExceptionHandler()
    {
        $previousHandler = null;
        if ($this->app->bound(ExceptionHandlerInterface::class) === true) {
            $previousHandler = $this->app->make(ExceptionHandlerInterface::class);
        }

        $this->app->singleton(ExceptionHandlerInterface::class, function () use ($previousHandler) {
            return new JsonApiExceptionHandler($this->app, $previousHandler);
        });
    }
965004
protected function getWhoopsHandler(): WhoopsHandlerInterface
	{
		if($this->returnAsJson())
		{
			return new JsonResponseHandler;
		}

		if($this->returnAsXml())
		{
			return new XmlResponseHandler;
		}

		$handler = new PrettyPageHandler;

		$handler->handleUnconditionally(true);

		$handler->setApplicationPaths([$this->app->getPath()]);

		$handler->setPageTitle('Error');

		$blacklist = $this->app->getConfig()->get('application.error_handler.debug_blacklist');

		if(!empty($blacklist))
		{
			foreach($blacklist as $superglobal => $keys)
			{
				foreach($keys as $key)
				{
					$handler->blacklist($superglobal, $key);
				}
			}
		}

		return $handler;
	}
293569
public function register()
    {
        if (!$this->registered) {
            error_reporting($this->errorLevel);
            set_exception_handler([$this, 'handleException']);
            set_error_handler([$this, 'handleError'], $this->errorLevel);
            register_shutdown_function([$this, 'handleShutdown']);

            $this->registered = true;
        }

        return $this;
    }
1111439
protected function processWhoopsBubbling($whoopsHandleResponse)
    {
        switch ($whoopsHandleResponse) {
            case Handler::LAST_HANDLER:
            case Handler::QUIT:
                // don't call further monolog handlers
                $this->setBubble(false);
        }
    }
415497
protected function registerDebugger(): void
    {
        $this->app->singleton('orchestra.debug', function ($app) {
            return new Debugger($app->make(ProfilerContract::class), $app->make('orchestra.debug.socket'));
        });
    }
1015028
public function registerErrorHandler()
    {
        $whoops = new \Whoops\Run();
        $configuration = $this->getConfiguration();

        if (isset($configuration['debug']) && $configuration['debug']) {
            $whoops->pushHandler(new \Whoops\Handler\PrettyPageHandler());
        } else {
            $whoops->pushHandler(new \Whoops\Handler\CallbackHandler(function ($exception) {
                $this->logger->error($exception->getMessage(), compact('exception'));

                $request = $this->container->get('request');
                $response = $this->container->get('response');
                $view = $this->container->get('view');
                $errorInfo = ['message' => $exception->getMessage()];

                if (is_a($exception, HttpException::class)) {
                    $errorInfo['code'] = $exception->getCode();
                } else {
                    $errorInfo['code'] = 500;
                }

                $headerAccept = $request->getHeader('Accept');
                if (in_array('application/json', $headerAccept)) {
                    $response = $response->withStatus($errorInfo['code']);
                    $response->getBody()->write(json_encode($errorInfo));

                    $response = $response->withHeader('Content-Type', 'application/json');
                } else {
                    $response = $view->render($response, 'error', $errorInfo);
                }

                $this->emitResponse($response);

                return \Whoops\Handler\Handler::DONE;
            }));
        }

        $whoops->register();
    }
667620
public function start()
    {
        $whoops  = new Run();
        $handler = new PrettyPageHandler();

        $handler->addResourcePath(__DIR__.'/Resources');
        $handler->setEditor('sublime');

        $whoops->pushHandler($handler);
        $whoops->register();

        $this->whoops = $whoops;
    }
1345395
public function register()
    {
        if (empty($this->formatterStack)) {
            throw new NoFormattersRegisteredException(
                'No formatters were registered before attempting to register the error handler'
            );
        }

        // We want the formatters we register to handle the errors.
        ini_set('display_errors', false);

        set_error_handler([$this, self::ERROR_HANDLER]);
        set_exception_handler([$this, self::EXCEPTION_HANDLER]);
        register_shutdown_function([$this, self::SHUTDOWN_HANDLER]);
    }
696038
protected function registerErrorHandle(): void
    {
        \set_error_handler([$this, 'handleError']);
        \set_exception_handler([$this, 'handleException']);
        \register_shutdown_function(function () {
            if ($e = \error_get_last()) {
                $this->handleError($e['type'], $e['message'], $e['file'], $e['line']);
            }
        });
    }
1291472
private function registerErrorHandler(): void
    {
        $whoops = new Run();
        $whoops->pushHandler(new PrettyPageHandler());
        $whoops->register();

        $this->errorHandler = $whoops;
    }
204133
public static function register() {
		ini_set('display_errors', 0);
		ini_set('display_startup_errors', 0);
		error_reporting(-1);

		static::$reservedMemory = str_repeat('a', 10240);
		static::$errorAtStart = error_get_last();

		$errorHandler = new static();
		set_error_handler([$errorHandler, 'phpErrorHandler']);
		set_exception_handler([$errorHandler, 'exceptionHandler']);

		return $errorHandler;
	}
1356104
public function boot()
    {
        /** @var Application\AbstractApplication $app */
        $app = $this->getContainer()->get(ApplicationInterface::class);

        $errorHandler = new Run(new ApplicationSystemFacade($app));
        $handlerService = new HandlerService($app);

        $errorHandler->pushHandler([$handlerService, 'recognizeErrorResponseHandler']);
        $errorHandler->pushHandler([$handlerService, 'notifySystemWithError']);
        $errorHandler->register();

        $service = new Application\Services\WhoopsService($errorHandler, $app);
        $this->getContainer()->share(Application\Services\WhoopsService::class, $service);
    }
395802
protected function registerErrorHandler()
    {
        $instance = $this;
        $this->previousErrorHandler = set_error_handler(
            function ($errno, $errstr, $errfile, $errline) use ($instance) {
                $message = sprintf('%d: %s - File: %s - Line: %d', $errno, $errstr, $errfile, $errline);
                throw new \Exception($message, $errno);
            }
        );
    }
388410
public function register()
    {
        // register custom ExceptionHandler
        if (class_exists('Chronos\Scaffolding\App\Exceptions\Handler')) {
            $this->app->singleton(
                \Illuminate\Contracts\Debug\ExceptionHandler::class,
                \Chronos\Scaffolding\App\Exceptions\Handler::class
            );
        }

        // default package configuration
        $this->mergeConfigFrom(
            __DIR__ . '/config/defaults.php', 'chronos'
        );

        // register RouteMap facade
        $this->app->singleton('routeMap', function($app) {
            return new RouteMapService();
        });
        $this->app->alias('routeMap', 'Chronos\Scaffolding\App\Services\RouteMapService');
    }
1220293
public function register()
    {
        $that = $this;
        set_error_handler(function ($errno, $errstr, $errfile, $errline) use ($that) {
            if (!($errno & error_reporting())) {
                return;
            }

            $options = [
                'type' => $errno,
                'message' => $errstr,
                'file' => $errfile,
                'line' => $errline,
                'isError' => true,
            ];
            $that->handle(new ErrorPayload($options));
        });

        set_exception_handler(function ($e) use ($that) {
            /** @var \Exception|\Error $e */
            $options = [
                'type' => $e->getCode(),
                'message' => $e->getMessage(),
                'file' => $e->getFile(),
                'line' => $e->getLine(),
                'isException' => true,
                'exception' => $e,
            ];
            $that->handle(new ErrorPayload($options));
        });

        register_shutdown_function(function () use ($that) {
            if (null !== ($options = error_get_last())) {
                $that->handle(new ErrorPayload($options));
            }
        });
    }
774117
public function register()
    {
        $this->publishes([$this->configPath() => config_path('go_aop.php')]);
        $this->mergeConfigFrom($this->configPath(), 'go_aop');

        $this->app->singleton(AspectKernel::class, function () {
            $aspectKernel = AspectLaravelKernel::getInstance();
            $aspectKernel->init(config('go_aop'));

            return $aspectKernel;
        });

        $this->app->singleton(AspectContainer::class, function ($app) {
            /** @var AspectKernel $kernel */
            $kernel = $app->make(AspectKernel::class);

            return $kernel->getContainer();
        });
    }