-
Notifications
You must be signed in to change notification settings - Fork 106
Closed
Description
I have some logic which checks the database state, and under some conditions I want to throw an exception of a suitable type.
For example: I want to return an error 400 Bad Request to the user with a message about what is wrong.
The docs state:
This package automatically handles converting common Laravel exceptions to these error objects, for example HTTP exceptions and validation exceptions.
So I throw a BadRequestException, passing my message as a parameter:
use Symfony\Component\HttpFoundation\Exception\BadRequestException;
/**/
throw new BadRequestException("message");However, client-side I receive:
{
"errors": [
{
"status": "500",
"title": "Internal Server Error"
}
]
}Which is the wrong status, and my error message is not included.
Why does this happen?
Metadata
Metadata
Assignees
Labels
No labels