8000 Allow render methods to be defined on exceptions · laravel/lumen-framework@a1b908e · GitHub
[go: up one dir, main page]

Skip to content

Commit a1b908e

Browse files
committed
Allow render methods to be defined on exceptions
1 parent f00a74e commit a1b908e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Exceptions/Handler.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@ protected function shouldntReport(Exception $e)
8686
*/
8787
public function render($request, Exception $e)
8888
{
89+
if (method_exists($e, 'render')) {
90+
return $e->render($request);
91+
}
92+
8993
if ($e instanceof HttpResponseException) {
9094
return $e->getResponse();
9195
} elseif ($e instanceof ModelNotFoundException) {

0 commit comments

Comments
 (0)
0