mirror of
https://github.com/tokio-rs/axum.git
synced 2026-08-20 00:00:11 +02:00
Add WithRejection (#1262)
* new(axum-extra): Added `WithRejection` base impl Based on @jplatte's version (https://github.com/tokio-rs/axum/issues/1116#issuecomment-1215048273), with slight changes - Using `From<E::Rejection>` to define the trait bound on a more concise way - Renamed variables to something more meaningfull * revert(axum-extra): Removed `with_rejection` feat * ref(axum-extra): Replaced `match` with `?` * tests(axum-extra): Added test for `WithRejection` * examples: Replaced custom `Json` extractor with `WithRejection` * docs(axum-extra): Added doc to `WithRejection` * fmt(cargo-check): removed whitespaces * fmt(customize-extractor-error): missing fmt * docs(axum-extra): doctest includes `Handler` test Co-authored-by: David Pedersen <[email protected]> * docs(axum-extra):` _ `-> `rejection` Co-authored-by: David Pedersen <[email protected]> * docs(axum-extra): fixed suggestions * fix(axum-extra): `WithRejection` manual trait impl * revert(customize-extractor-error): Undo example changes refs:d878eede18,f9200bf4b9* example(customize-extractor-error): Added reference to `WithRejection` * docs(axum-extra): Removed `customize-extractor-error` reference * fmt(axum-extra): cargo fmt * docs(axum-extra): Added `WithRejection` to CHANGELOG.md Co-authored-by: David Pedersen <[email protected]>
This commit is contained in:
co-authored by
David Pedersen
parent
01630cfef6
commit
fb21561616
@@ -3,6 +3,9 @@
|
||||
//! ```not_rust
|
||||
//! cd examples && cargo run -p example-customize-extractor-error
|
||||
//! ```
|
||||
//!
|
||||
//! See https://docs.rs/axum-extra/0.3.7/axum_extra/extract/struct.WithRejection.html
|
||||
//! example for creating custom errors from already existing extractors
|
||||
|
||||
use axum::{
|
||||
async_trait,
|
||||
|
||||
Reference in New Issue
Block a user