From 76049c58605331e8b171fada29e48daeba328ca6 Mon Sep 17 00:00:00 2001 From: Dane Everitt Date: Mon, 8 Feb 2016 17:59:37 -0500 Subject: [PATCH] Improved exception handler for AJAX requests --- app/Exceptions/Handler.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index d3a4599a7..eba6f488e 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -72,10 +72,11 @@ class Handler extends ExceptionHandler // If we are debugging, return the exception in it's full manner. return response()->json([ - 'error' => $e->getMessage(), + 'error' => (empty($e->getMessage())) ? $exception : $e->getMessage(), 'code' => $e->getCode(), 'file' => $e->getFile(), - 'line' => $e->getLine() + 'line' => $e->getLine(), + 'trace' => $e->getTrace(), ], 500); }