diff --git a/Bridges/HttpKernel.php b/Bridges/HttpKernel.php index 07693f8..3308d67 100644 --- a/Bridges/HttpKernel.php +++ b/Bridges/HttpKernel.php @@ -81,22 +81,12 @@ public function handle(ServerRequestInterface $request) // headers_sent() returns true if any unbuffered output reaches cgi stdout. ob_start(); - try { - if ($this->bootstrap instanceof HooksInterface) { - $this->bootstrap->preHandle($this->application); - } - - $syResponse = $this->application->handle($syRequest); - } catch (\Exception $exception) { - // internal server error - error_log((string)$exception); - $response = new Psr7\Response(500, ['Content-type' => 'text/plain'], 'Unexpected error'); - - // end buffering if we need to throw - @ob_end_clean(); - return $response; + if ($this->bootstrap instanceof HooksInterface) { + $this->bootstrap->preHandle($this->application); } + $syResponse = $this->application->handle($syRequest); + $out = ob_get_clean(); $response = $this->mapResponse($syResponse, $out);