Write http errors for API to log
This commit is contained in:
parent
9dc963ad29
commit
8caabb9153
@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
namespace App\Exceptions;
|
namespace App\Exceptions;
|
||||||
|
|
||||||
use Illuminate\Database\Eloquent\ModelNotFoundException;
|
|
||||||
use Log;
|
use Log;
|
||||||
|
use Illuminate\Database\Eloquent\ModelNotFoundException;
|
||||||
use Exception;
|
use Exception;
|
||||||
use Illuminate\Auth\AuthenticationException;
|
use Illuminate\Auth\AuthenticationException;
|
||||||
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
|
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
|
||||||
@ -64,6 +64,8 @@ class Handler extends ExceptionHandler
|
|||||||
$http_code = 404;
|
$http_code = 404;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Log::error($exception->getMessage());
|
||||||
|
|
||||||
return response()->json([
|
return response()->json([
|
||||||
'error' => [
|
'error' => [
|
||||||
'code' => $exception->getCode() ,
|
'code' => $exception->getCode() ,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user