From 3ba8467870b1a1a61581b567d06193388a827631 Mon Sep 17 00:00:00 2001 From: Adam Lavin Date: Mon, 30 Nov 2015 01:00:20 +0000 Subject: [PATCH] Return error message in profile exception handler response --- app/Http/Middleware/Profiler.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/Http/Middleware/Profiler.php b/app/Http/Middleware/Profiler.php index 6eabebbf..ba8214a6 100644 --- a/app/Http/Middleware/Profiler.php +++ b/app/Http/Middleware/Profiler.php @@ -47,9 +47,11 @@ class Profiler try { $response = $next($request); - } catch (\Exception $e) { - $response = \Response::make(['exception' => $e->getTrace()], 500); + $response = \Response::make([ + 'message' => $e->getMessage(), + 'exception' => $e->getTrace() + ], 500); $profiler->log('error', $e->__toString(), []); }