#[non_exhaustive]pub enum ExtractPathParamsError {
InvalidUtf8InPathParameter(InvalidUtf8InPathParam),
PathDeserializationError(PathDeserializationError),
}
Expand description
The error returned by PathParams::extract
when the extraction fails.
See PathParams::extract
and the documentation of each error variant for more details.
Pavex provides ExtractPathParamsError::into_response
as the default error handler for
this failure.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
InvalidUtf8InPathParameter(InvalidUtf8InPathParam)
See InvalidUtf8InPathParam
for details.
PathDeserializationError(PathDeserializationError)
See PathDeserializationError
for details.
Implementations§
source§impl ExtractPathParamsError
impl ExtractPathParamsError
sourcepub fn into_response(&self) -> Response
pub fn into_response(&self) -> Response
Convert an ExtractPathParamsError
into an HTTP response.
It returns a 500 Internal Server Error
to the caller if the failure was caused by a
programmer error (e.g. T
in PathParams<T>
is an unsupported type).
It returns a 400 Bad Request
for all other cases.
Trait Implementations§
source§impl Debug for ExtractPathParamsError
impl Debug for ExtractPathParamsError
source§impl Display for ExtractPathParamsError
impl Display for ExtractPathParamsError
source§impl Error for ExtractPathParamsError
impl Error for ExtractPathParamsError
source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for ExtractPathParamsError
impl RefUnwindSafe for ExtractPathParamsError
impl Send for ExtractPathParamsError
impl Sync for ExtractPathParamsError
impl Unpin for ExtractPathParamsError
impl UnwindSafe for ExtractPathParamsError
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more