mirror of
https://github.com/fafhrd91/actix-web
synced 2025-07-01 16:55:08 +02:00
migrate to -utils beta 4 (#2127)
This commit is contained in:
@ -6,9 +6,6 @@ use std::str::Utf8Error;
|
||||
use std::string::FromUtf8Error;
|
||||
use std::{fmt, io, result};
|
||||
|
||||
use actix_codec::{Decoder, Encoder};
|
||||
use actix_utils::dispatcher::DispatcherError as FramedDispatcherError;
|
||||
use actix_utils::timeout::TimeoutError;
|
||||
use bytes::BytesMut;
|
||||
use derive_more::{Display, From};
|
||||
use http::uri::InvalidUri;
|
||||
@ -148,19 +145,6 @@ impl From<ResponseBuilder> for Error {
|
||||
}
|
||||
}
|
||||
|
||||
/// Inspects the underlying enum and returns an appropriate status code.
|
||||
///
|
||||
/// If the variant is [`TimeoutError::Service`], the error code of the service is returned.
|
||||
/// Otherwise, [`StatusCode::GATEWAY_TIMEOUT`] is returned.
|
||||
impl<E: ResponseError> ResponseError for TimeoutError<E> {
|
||||
fn status_code(&self) -> StatusCode {
|
||||
match self {
|
||||
TimeoutError::Service(e) => e.status_code(),
|
||||
TimeoutError::Timeout => StatusCode::GATEWAY_TIMEOUT,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Display)]
|
||||
#[display(fmt = "UnknownError")]
|
||||
struct UnitError;
|
||||
@ -469,14 +453,6 @@ impl ResponseError for ContentTypeError {
|
||||
}
|
||||
}
|
||||
|
||||
impl<E, U: Encoder<I> + Decoder, I> ResponseError for FramedDispatcherError<E, U, I>
|
||||
where
|
||||
E: fmt::Debug + fmt::Display,
|
||||
<U as Encoder<I>>::Error: fmt::Debug,
|
||||
<U as Decoder>::Error: fmt::Debug,
|
||||
{
|
||||
}
|
||||
|
||||
/// Helper type that can wrap any error and generate custom response.
|
||||
///
|
||||
/// In following example any `io::Error` will be converted into "BAD REQUEST"
|
||||
|
Reference in New Issue
Block a user