Skip to content

How can response::status::BadRequest be caugth? #2702

Answered by SergioBenitez
Quba1 asked this question in Questions
Discussion options

You must be logged in to vote

I think there's a fundamental misunderstanding with respect to error catchers. Error catchers react to failures at the routing level, not to responses with a failing status code. A response with a failing status code is just that and only that: an HTTP response with a status code >= 400.

Error catchers catch failures at the routing level. Those failures are also marked with a status code, but there is no associated HTTP response with that status code: it merely indicates the kind of routing error that occurred and is used to route the error to the appropriate catcher. It may also provide a hint towards the kind of HTTP response that should be generated as a result of the routing failure, …

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@Quba1
Comment options

@SergioBenitez
Comment options

Answer selected by Quba1
@Saplyn
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants