Skip to content

Commit

Permalink
Add note on default responses if extraction fails
Browse files Browse the repository at this point in the history
This is useful in case one does not want to expose internal error
messages through the interface.

Fixes tokio-rs#1167
  • Loading branch information
simon-amadeus committed Jul 15, 2022
1 parent 329bd5f commit ca5eaea
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions axum/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@
//! async fn json(Json(payload): Json<serde_json::Value>) {}
//! ```
//!
//! If an extraction fails, axum [`rejects`](crate::extract::rejection) requests
//! and responds with an appropriate status code and the respective error message.
//! This behavior can be adapted by customizing extractor responses.
//!
//! See [`extract`](crate::extract) for more details on extractors.
//!
//! # Responses
Expand Down

0 comments on commit ca5eaea

Please sign in to comment.