Beispiel #1
0
 function handle(\Exception $exception)
 {
     if ($this->app) {
         try {
             $exception = $this->app->hook('app.exception', $this, $exception);
         } catch (\Exception $innerEx) {
             return $this->_handleNested($exception, $innerEx);
         }
     }
     if ($exception) {
         if ($this->app && !$this->app->core->debug) {
             try {
                 $code = $exception instanceof HttpExceptionInterface ? $exception->getStatusCode() : 500;
                 $response = new Response\FancyResponse(new Request\StaticRequest($this->app), array('code' => $code, 'title' => SymfonyResponse::$statusTexts[$code], 'exception' => $exception), 'error.html.twig');
                 $response->statusCode = $code;
                 $response->send();
                 return;
             } catch (\Exception $innerEx) {
                 return $this->_handleNested($exception, $innerEx);
             }
         }
         parent::handle($exception);
     }
 }