axum/examples/customize-extractor-error/README.md
Jonas Platte dc480f7b0e
Re-integrate examples into the root workspace (#1466)
Co-authored-by: David Pedersen <david.pdrsn@gmail.com>
2023-03-10 12:02:11 +01:00

566 B

This example explores 3 different ways you can create custom rejections for already existing extractors

  • with_rejection: Uses axum_extra::extract::WithRejection to transform one rejection into another
  • derive_from_request: Uses axum_macros::FromRequest to wrap another extractor and customize the rejection
  • custom_extractor: Manual implementation of FromRequest that wraps another extractor

Run with

cargo run -p example-customize-extractor-error