diff piecrust/templating/jinjaengine.py @ 864:5c5b85d4f17d

debug: Raise Jinja template exceptions the same way in both render passes.
author Ludovic Chabant <ludovic@chabant.com>
date Thu, 08 Jun 2017 23:31:45 -0700
parents 448710d84121
children 3e69f18912f5
line wrap: on
line diff
--- a/piecrust/templating/jinjaengine.py	Thu Jun 08 23:30:42 2017 -0700
+++ b/piecrust/templating/jinjaengine.py	Thu Jun 08 23:31:45 2017 -0700
@@ -72,6 +72,8 @@
         except AbortedSourceUseError:
             raise
         except Exception as ex:
+            if self.app.debug:
+                raise
             msg = "Error rendering Jinja markup"
             rel_path = os.path.relpath(rendered_path, self.app.root_dir)
             raise TemplatingError(msg, rel_path) from ex