Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Exception Handler to allow anything “Throwable” #29

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions app/Exceptions/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,25 @@

namespace App\Exceptions;

use Exception;
use Psr\Http\Message\ResponseInterface;
use Rareloop\Lumberjack\Exceptions\Handler as LumberjackHandler;
use Rareloop\Lumberjack\Facades\Config;
use Rareloop\Lumberjack\Facades\Log;
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 {
Expand All @@ -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);
}
Expand Down