Closed
Description
I've got a couple of error handlers:
App::error(function(\Illuminate\Database\Eloquent\ModelNotFoundException $exception)
{
// Both end up with an "Error in exception handler" error.
//App::abort(404);
//throw new Symfony\Component\HttpKernel\Exception\HttpException(404, null, $exception);
});
App::error(function(\Symfony\Component\HttpKernel\Exception\HttpException $exception)
{
// I want to end up in here where I have generic http error handling code
});
Using MyModel::findOrFail($id)
can throw the ModelNotFoundException
which I'm catching but using App::abort
or throwing a new exception from within the handler errors with an "Error in exception handler" error (from https://github.com/laravel/framework/blob/master/src/Illuminate/Exception/Handler.php#L318).
Is it not possible to re-throw an error in this way?
I can work around it by overriding findOrFail()
in a base Model but I was wondering if the above could or should work?
Metadata
Metadata
Assignees
Labels
No labels