mirror of
https://github.com/tokio-rs/axum.git
synced 2026-08-18 00:00:15 +02:00
More work
This commit is contained in:
@@ -49,6 +49,16 @@ pub enum Error {
|
||||
InvalidUtf8,
|
||||
}
|
||||
|
||||
impl Error {
|
||||
/// Create an `Error` from a `BoxError` coming from a `Service`
|
||||
pub(crate) fn from_service_error(error: BoxError) -> Error {
|
||||
match error.downcast::<Error>() {
|
||||
Ok(err) => *err,
|
||||
Err(err) => Error::Service(err),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<Infallible> for Error {
|
||||
fn from(err: Infallible) -> Self {
|
||||
match err {}
|
||||
|
||||
Reference in New Issue
Block a user