You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A request not matching an extractor is not considered an error in axum, so handle_error doesn't apply.
This wasn't very well explained in axum 0.2's documentation but have been improved in 0.3, which I'm hoping to release today. I recommend you read through error handling and extractor which hopefully makes things more clear. While the docs are using 0.3 there should be very few differences in those areas between 0.2 and 0.3.
Bug Report
Version
├── axum v0.2.8
Platform
Linux laptop 5.10.70-1-MANJARO #1 SMP PREEMPT Thu Sep 30 15:29:01 UTC 2021 x86_64 GNU/Linux
Crates
serde
Description
I'm using the JSON extractor to deserialize Body into a defined struct.
With the following code:
If I make the right request like
the handler gets called and all is fine.
However, if the request is not valid, like
the server will respond with a 400. This is to be expected, except
handle_error
does not get calledI expected
handle_error
to get the error so that I can handle the 400 response myselfThe text was updated successfully, but these errors were encountered: