Write http errors for API to log

This commit is contained in:
Nabeel Shahzad
2018-01-24 14:14:47 -06:00
parent 9dc963ad29
commit 8caabb9153

View File

@@ -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() ,