diff --git a/Cargo.toml b/Cargo.toml index 080c69e..a956dda 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,6 +8,7 @@ license = "MIT" keywords = ["error", "result"] [dependencies] +askama = { version = "0.12", optional = true } serde_json = { version = "1.0", optional = true } ureq = { version = "2.6", optional = true } diff --git a/src/lib.rs b/src/lib.rs index 6ea5662..ccca25b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -63,6 +63,13 @@ impl From for Rear { } } +#[cfg(feature = "askama")] +impl From for Rear { + fn from(error: askama::Error) -> Self { + Self { message: error.to_string(), error: error.into() } + } +} + #[cfg(feature = "serde_json")] impl From for Rear { fn from(error: serde_json::Error) -> Self {