Skip to content

Commit

Permalink
impl ResponseError for SendError when possible (actix#619)
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanpailes authored and DoumanAsh committed Dec 11, 2018
1 parent 86af021 commit 90eef31
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@

* Implement `FromRequest` extractor for `Either<A,B>`

* Implement `ResponseError` for `SendError`


## [0.7.15] - 2018-12-05

### Changed
Expand Down
6 changes: 5 additions & 1 deletion src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use std::string::FromUtf8Error;
use std::sync::Mutex;
use std::{fmt, io, result};

use actix::MailboxError;
use actix::{MailboxError, SendError};
use cookie;
use failure::{self, Backtrace, Fail};
use futures::Canceled;
Expand Down Expand Up @@ -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 {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
fmt::Display::fmt(&self.cause, f)
Expand Down

0 comments on commit 90eef31

Please sign in to comment.