diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index 2428aff8..0181adb0 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -2,7 +2,6 @@ namespace App\Exceptions; -use Exception; use Psr\Http\Message\ResponseInterface; use Rareloop\Lumberjack\Exceptions\Handler as LumberjackHandler; use Rareloop\Lumberjack\Facades\Config; @@ -10,17 +9,18 @@ use Rareloop\Lumberjack\Http\Responses\TimberResponse; use Timber\Timber; use Psr\Http\Message\ServerRequestInterface; +use Throwable; class Handler extends LumberjackHandler { protected $dontReport = []; - public function report(Exception $e) + public function report(Throwable $e) { parent::report($e); } - public function render(ServerRequestInterface $request, Exception $e): ResponseInterface + public function render(ServerRequestInterface $request, Throwable $e): ResponseInterface { // Provide a customisable error rendering when not in debug mode try { @@ -30,7 +30,7 @@ public function render(ServerRequestInterface $request, Exception $e): ResponseI return new TimberResponse('templates/errors/whoops.twig', $data, 500); } - } catch (Exception $customRenderException) { + } catch (Throwable $customRenderException) { // Something went wrong in the custom renderer, log it and show the default rendering Log::error($customRenderException); }