Skip to content

Commit 76049c5

Browse files
committed
Improved exception handler for AJAX requests
1 parent 037a923 commit 76049c5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

app/Exceptions/Handler.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,11 @@ public function render($request, Exception $e)
7272

7373
// If we are debugging, return the exception in it's full manner.
7474
return response()->json([
75-
'error' => $e->getMessage(),
75+
'error' => (empty($e->getMessage())) ? $exception : $e->getMessage(),
7676
'code' => $e->getCode(),
7777
'file' => $e->getFile(),
78-
'line' => $e->getLine()
78+
'line' => $e->getLine(),
79+
'trace' => $e->getTrace(),
7980
], 500);
8081

8182
}

0 commit comments

Comments
 (0)