From 90eef31cc0ee0304bb1d0eaab7e44aaa6181e99e Mon Sep 17 00:00:00 2001 From: ethanpailes Date: Tue, 11 Dec 2018 11:37:52 -0500 Subject: [PATCH] impl ResponseError for SendError when possible (#619) --- CHANGES.md | 3 +++ src/error.rs | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 11e639a88..05f831ae3 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -6,6 +6,9 @@ * Implement `FromRequest` extractor for `Either` +* Implement `ResponseError` for `SendError` + + ## [0.7.15] - 2018-12-05 ### Changed diff --git a/src/error.rs b/src/error.rs index 1766c1523..f4ea981c0 100644 --- a/src/error.rs +++ b/src/error.rs @@ -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; @@ -136,6 +136,10 @@ pub trait ResponseError: Fail + InternalResponseErrorAsFail { } } +impl ResponseError for SendError +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)