aboutsummaryrefslogtreecommitdiffstats
path: root/askama_derive/src/generator.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--askama_derive/src/generator.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/askama_derive/src/generator.rs b/askama_derive/src/generator.rs
index f8b9ecb..f17b6f6 100644
--- a/askama_derive/src/generator.rs
+++ b/askama_derive/src/generator.rs
@@ -259,7 +259,11 @@ mod _parsed {
// internally we will transmute it to `&'static str` to satisfy the compiler.
// However, we only expose the nodes with a lifetime limited to `self`.
let src = unsafe { mem::transmute::<&str, &'static str>(source.as_str()) };
- let nodes = parse(src, syntax)?;
+ let nodes = match parse(src, syntax) {
+ Ok(nodes) => nodes,
+ Err(e) => return Err(e.to_string().into()),
+ };
+
Ok(Self { source, nodes })
}