Add tracing calls when an extension parameter cannot be constructed (#3378)
## Motivation and Context
When a user defines a handler function with additional parameters, these
parameters are constructed using the `FromRequest` trait implementation
specific to their types. If `FromRequest` fails to construct the
parameter – for instance, if `Extension<State>` is expected by the user
but `Extension<Arc<State>>` is actually added by the extension layer –
the server currently does not log a message indicating this construction
failure. Instead, it simply returns a 500 internal server error.
## Description
`tracing::{trace, error}` calls have been added.
## Breaking change
`FromParts<P>::Rejection` **must** implement `std::fmt::Display`.
----
_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
---------
Co-authored-by:
Fahad Zubair <fahadzub@amazon.com>
Loading
Please register or sign in to comment