2022-08-19 15:11:03 +02:00
|
|
|
This example explores 3 different ways you can create custom rejections for
|
|
|
|
|
already existing extractors
|
|
|
|
|
|
|
|
|
|
- [`with_rejection`](src/with_rejection.rs): Uses
|
|
|
|
|
`axum_extra::extract::WithRejection` to transform one rejection into another
|
2023-07-26 20:21:39 +02:00
|
|
|
- [`derive_from_request`](src/derive_from_request.rs): Uses the
|
2023-07-27 17:03:10 +03:00
|
|
|
`axum::extract::FromRequest` derive macro to wrap another extractor and
|
2023-07-26 20:21:39 +02:00
|
|
|
customize the rejection
|
2022-08-19 15:11:03 +02:00
|
|
|
- [`custom_extractor`](src/custom_extractor.rs): Manual implementation of
|
|
|
|
|
`FromRequest` that wraps another extractor
|
|
|
|
|
|
|
|
|
|
Run with
|
|
|
|
|
|
|
|
|
|
```sh
|
2023-03-10 12:02:11 +01:00
|
|
|
cargo run -p example-customize-extractor-error
|
2022-08-19 15:11:03 +02:00
|
|
|
```
|