about summary refs log tree commit diff
path: root/src/errors.rs
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@gmail.com>2018-04-08T20·56+0200
committerVincent Ambo <tazjin@gmail.com>2018-04-08T20·56+0200
commit9eb8501fae4b4024e1b2d052b213351deeae8b81 (patch)
tree574497a9391304d1c5c4785210bfbf711a92826a /src/errors.rs
parente761b2d295c920da153ac673892cfd9616e6a2b7 (diff)
feat(handlers): Use cookie session backend to store author info
Diffstat (limited to 'src/errors.rs')
-rw-r--r--src/errors.rs14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/errors.rs b/src/errors.rs
index d07d19cd3790..cf75f0e29853 100644
--- a/src/errors.rs
+++ b/src/errors.rs
@@ -9,6 +9,7 @@ use actix_web::http::StatusCode;
 
 // Modules with foreign errors:
 use actix;
+use actix_web;
 use diesel;
 use r2d2;
 use reqwest;
@@ -30,11 +31,14 @@ pub enum ConverseError {
     #[fail(display = "a template rendering error occured: {}", reason)]
     Template { reason: String },
 
+    #[fail(display = "error occured during request handling: {}", error)]
+    ActixWeb { error: actix_web::Error },
+
     // This variant is used as a catch-all for wrapping
     // actix-web-compatible response errors, such as the errors it
     // throws itself.
     #[fail(display = "Actix response error: {}", error)]
-    ActixWeb { error: Box<ResponseError> },
+    Actix { error: Box<ResponseError> },
 }
 
 // Establish conversion links to foreign errors:
@@ -61,7 +65,13 @@ impl From<tera::Error> for ConverseError {
 
 impl From<actix::MailboxError> for ConverseError {
     fn from(error: actix::MailboxError) -> ConverseError {
-        ConverseError::ActixWeb { error: Box::new(error) }
+        ConverseError::Actix { error: Box::new(error) }
+    }
+}
+
+impl From<actix_web::Error> for ConverseError {
+    fn from(error: actix_web::Error) -> ConverseError {
+        ConverseError::ActixWeb { error }
     }
 }