Better handling of "findOrFail" Eloquent calls, to actually show a useful error message, which is correctly formatted

This commit is contained in:
manavo
2014-12-02 11:13:20 +00:00
parent ed13b46e76
commit dd5fcd6189

View File

@@ -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