Skip to content

Commit

Permalink
Handle exception while app env is testing
Browse files Browse the repository at this point in the history
  • Loading branch information
mh-codeoptimizer committed Jan 7, 2024
1 parent 0807344 commit 35e541b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Illuminate/Foundation/Exceptions/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,8 @@ public function render($request, Throwable $e)
{
$e = $this->mapException($e);

if (app()->environment() === 'testing') throw $e;

if (method_exists($e, 'render') && $response = $e->render($request)) {
return Router::toResponse($request, $response);
}
Expand Down

0 comments on commit 35e541b

Please sign in to comment.