Skip to content

Commit

Permalink
Use HtmlErrorRenderer
Browse files Browse the repository at this point in the history
  • Loading branch information
AliceKLWilliams committed Mar 20, 2024
1 parent cc991aa commit 27681e3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Exceptions/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use Psr\Http\Message\ServerRequestInterface;
use Rareloop\Lumberjack\Application;
use Rareloop\Lumberjack\Facades\Config;
use Symfony\Component\ErrorHandler\ErrorHandler as SymfonyExceptionHandler;
use Symfony\Component\ErrorHandler\ErrorRenderer\HtmlErrorRenderer;
use Symfony\Component\ErrorHandler\Exception\FlattenException;
use Zend\Diactoros\Response\HtmlResponse;

Expand Down Expand Up @@ -38,9 +38,9 @@ public function render(ServerRequestInterface $request, Exception $e) : Response
{
$e = FlattenException::create($e);

$handler = new SymfonyExceptionHandler(null, Config::get('app.debug', false));
$htmlRenderer = new HtmlErrorRenderer(Config::get('app.debug', false));

return new HtmlResponse($handler->getHtml($e), $e->getStatusCode(), $e->getHeaders());
return new HtmlResponse($htmlRenderer->getBody($e), $e->getStatusCode(), $e->getHeaders());
}

protected function shouldNotReport(Exception $e)
Expand Down

0 comments on commit 27681e3

Please sign in to comment.