about summary refs log tree commit diff
path: root/src/errors.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/errors.rs')
-rw-r--r--src/errors.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/errors.rs b/src/errors.rs
index c4c2be198e85..05642d0a8598 100644
--- a/src/errors.rs
+++ b/src/errors.rs
@@ -28,6 +28,7 @@ use actix_web::http::StatusCode;
 // Modules with foreign errors:
 use actix;
 use actix_web;
+use askama;
 use diesel;
 use r2d2;
 use reqwest;
@@ -50,6 +51,9 @@ pub enum ConverseError {
     #[fail(display = "a template rendering error occured: {}", reason)]
     Template { reason: String },
 
+    #[fail(display = "a template rendering error occured: {}", reason)]
+    Askama { reason: String },
+
     #[fail(display = "error occured during request handling: {}", error)]
     ActixWeb { error: actix_web::Error },
 
@@ -88,6 +92,14 @@ impl From<tera::Error> for ConverseError {
     }
 }
 
+impl From<askama::Error> for ConverseError {
+    fn from(error: askama::Error) -> ConverseError {
+        ConverseError::Askama {
+            reason: format!("{}", error),
+        }
+    }
+}
+
 impl From<actix::MailboxError> for ConverseError {
     fn from(error: actix::MailboxError) -> ConverseError {
         ConverseError::Actix { error: Box::new(error) }