diff --git a/src/error.rs b/src/error.rs index 3218f410e..d166636a7 100644 --- a/src/error.rs +++ b/src/error.rs @@ -4,11 +4,9 @@ use std::str::Utf8Error; use std::string::FromUtf8Error; use std::io::Error as IoError; -#[cfg(actix_nightly)] -use std::error::Error as StdError; - use cookie; use httparse; +use actix::MailboxError; use futures::Canceled; use failure; use failure::{Fail, Backtrace}; @@ -96,6 +94,7 @@ impl From for Error { } } +/// Compatibility for `failure::Error` impl ResponseError for failure::Compat where T: fmt::Display + fmt::Debug + Sync + Send + 'static { } @@ -106,14 +105,6 @@ impl From for Error { } } -/// Default error is `InternalServerError` -#[cfg(actix_nightly)] -default impl ResponseError for T { - fn error_response(&self) -> HttpResponse { - HttpResponse::new(StatusCode::INTERNAL_SERVER_ERROR, Body::Empty) - } -} - /// `InternalServerError` for `JsonError` impl ResponseError for JsonError {} @@ -145,6 +136,9 @@ impl ResponseError for header::InvalidHeaderValue {} /// `InternalServerError` for `futures::Canceled` impl ResponseError for Canceled {} +/// `InternalServerError` for `actix::MailboxError` +impl ResponseError for MailboxError {} + /// A set of errors that can occur during parsing HTTP streams #[derive(Fail, Debug)] pub enum ParseError {