/**
  * {@inheritdoc}
  */
 public function register()
 {
     $errorHandler = new ErrorHandler();
     $displayErrors = $this->container->get('config')->get('application.error_handler.display_errors');
     $errorHandler->handle('\\Exception', function ($exception) use($errorHandler, $displayErrors) {
         $this->setLogger($errorHandler);
         $webHandler = new CLIHandler($exception, $this->container->get('output'));
         return $webHandler->handle($displayErrors);
     });
     $this->container->registerInstance(['mako\\error\\ErrorHandler', 'errorHandler'], $errorHandler);
 }
示例#2
0
 /**
  * {@inheritdoc}
  */
 public function register()
 {
     $errorHandler = new ErrorHandler();
     $displayErrors = $this->container->get('config')->get('application.error_handler.display_errors');
     $errorHandler->handle('\\Throwable', function ($exception) use($errorHandler, $displayErrors) {
         $this->setLogger($errorHandler);
         $webHandler = new WebHandler($exception, $this->container->get('request'), $this->container->getFresh('response'), $this->container->get('view'));
         return $webHandler->handle($displayErrors);
     });
     $this->container->registerInstance([ErrorHandler::class, 'errorHandler'], $errorHandler);
 }