chiark / gitweb /
Tera templates: Add entry for rendering error to InternalError
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 27 Mar 2022 19:05:42 +0000 (20:05 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 27 Mar 2022 23:50:26 +0000 (00:50 +0100)
Template rendering errors during web page rendering were previously
handled by Rocket.  We are going to have to deal with them ourselves.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
src/error.rs

index 035ed65f19974d34c55a16c7b854579c80ea9e83..7b4a79aceea8ea2af47e73e64556d66835a812de 100644 (file)
@@ -3,6 +3,7 @@
 // There is NO WARRANTY.
 
 use crate::prelude::*;
+use tera_standalone as tera;
 
 #[derive(Error,Debug)]
 pub enum Fatal { // Includes _bogus_ client updates, see PROTOCOL.md
@@ -54,6 +55,8 @@ pub enum InternalError {
   Aggregated,
   #[error("{0}")]
   SshKeysManipError(#[from] sshkeys::AuthKeysManipError),
+  #[error("Template rendering error")]
+  TemplateRenderingError(#[from] tera::Error),
 }
 
 #[derive(Error,Copy,Clone,Debug,Serialize,Deserialize)]