diff options
Diffstat (limited to 'src/errors.rs')
-rw-r--r-- | src/errors.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/errors.rs b/src/errors.rs index 3cbda5f4e55d..d07d19cd3790 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -11,6 +11,7 @@ use actix_web::http::StatusCode; use actix; use diesel; use r2d2; +use reqwest; use tera; pub type Result<T> = result::Result<T, ConverseError>; @@ -64,6 +65,14 @@ impl From<actix::MailboxError> for ConverseError { } } +impl From<reqwest::Error> for ConverseError { + fn from(error: reqwest::Error) -> ConverseError { + ConverseError::InternalError { + reason: format!("Failed to make HTTP request: {}", error), + } + } +} + // Support conversion of error type into HTTP error responses: impl ResponseError for ConverseError { |