Better handling of "findOrFail" Eloquent calls, to actually show a useful error message, which is correctly formatted
This commit is contained in:
@@ -53,6 +53,10 @@ App::error(function(Exception $exception, $code)
|
||||
Log::error($exception);
|
||||
});
|
||||
|
||||
API::error(function (\Illuminate\Database\Eloquent\ModelNotFoundException $exception) {
|
||||
return Response::make(['error' => $exception->getMessage()], 404);
|
||||
});
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Maintenance Mode Handler
|
||||
|
||||
Reference in New Issue
Block a user