impl ResponseError for SendError when possible

Closes #528
This commit is contained in:
Ethan Pailes 2018-12-09 18:31:35 -05:00
parent ac9fc662c6
commit 6820d580fe
2 changed files with 7 additions and 1 deletions

View File

@ -1,5 +1,7 @@
# Changes # Changes
* `SendError` now implements `ResponseError`.
## [0.7.15] - 2018-12-05 ## [0.7.15] - 2018-12-05
## Changed ## Changed

View File

@ -5,7 +5,7 @@ use std::string::FromUtf8Error;
use std::sync::Mutex; use std::sync::Mutex;
use std::{fmt, io, result}; use std::{fmt, io, result};
use actix::MailboxError; use actix::{MailboxError, SendError};
use cookie; use cookie;
use failure::{self, Backtrace, Fail}; use failure::{self, Backtrace, Fail};
use futures::Canceled; use futures::Canceled;
@ -136,6 +136,10 @@ pub trait ResponseError: Fail + InternalResponseErrorAsFail {
} }
} }
impl<T> ResponseError for SendError<T>
where T: Send + Sync + 'static {
}
impl fmt::Display for Error { impl fmt::Display for Error {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
fmt::Display::fmt(&self.cause, f) fmt::Display::fmt(&self.cause, f)