Skip to content

Commit

Permalink
Allow render methods to be defined on exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
owenvoke committed Aug 28, 2019
1 parent f00a74e commit a1b908e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Exceptions/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ protected function shouldntReport(Exception $e)
*/
public function render($request, Exception $e)
{
if (method_exists($e, 'render')) {
return $e->render($request);
}

if ($e instanceof HttpResponseException) {
return $e->getResponse();
} elseif ($e instanceof ModelNotFoundException) {
Expand Down

0 comments on commit a1b908e

Please sign in to comment.