From 8caabb915353c6885817341cb6810d3b59264c91 Mon Sep 17 00:00:00 2001 From: Nabeel Shahzad Date: Wed, 24 Jan 2018 14:14:47 -0600 Subject: [PATCH] Write http errors for API to log --- app/Exceptions/Handler.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index c182147b..35b5bb7a 100755 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -2,8 +2,8 @@ namespace App\Exceptions; -use Illuminate\Database\Eloquent\ModelNotFoundException; use Log; +use Illuminate\Database\Eloquent\ModelNotFoundException; use Exception; use Illuminate\Auth\AuthenticationException; use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; @@ -64,6 +64,8 @@ class Handler extends ExceptionHandler $http_code = 404; } + Log::error($exception->getMessage()); + return response()->json([ 'error' => [ 'code' => $exception->getCode() ,