예제 #1
0
 /**
  * @param RequestInterface $request
  * @param \Closure $next
  * @return ResponseInterface
  */
 public function handle(RequestInterface $request, \Closure $next) : ResponseInterface
 {
     try {
         return $next($request);
     } catch (\Throwable $e) {
         $this->run->allowQuit(false);
         $this->run->sendHttpCode(false);
         $this->run->writeToOutput(false);
         return $this->responseFactory->createResponse($e->getCode() >= 400 ? $e->getCode() : 500)->append($this->run->handleException($e));
     }
 }
예제 #2
0
 /**
  * Pushing default error handlers
  *
  * @param RunInterface $run
  * @return void
  */
 public function errors(RunInterface $run)
 {
     $run->pushHandler($this->container->get(ErrorHandlerLogger::class));
 }
예제 #3
0
 public function disable()
 {
     $this->whoops->unregister();
 }