Mercurial > piecrust2
comparison 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 |
comparison
equal
deleted
inserted
replaced
863:01458d3b646b | 864:5c5b85d4f17d |
---|---|
70 except self._jinja_syntax_error as tse: | 70 except self._jinja_syntax_error as tse: |
71 raise self._getTemplatingError(tse) | 71 raise self._getTemplatingError(tse) |
72 except AbortedSourceUseError: | 72 except AbortedSourceUseError: |
73 raise | 73 raise |
74 except Exception as ex: | 74 except Exception as ex: |
75 if self.app.debug: | |
76 raise | |
75 msg = "Error rendering Jinja markup" | 77 msg = "Error rendering Jinja markup" |
76 rel_path = os.path.relpath(rendered_path, self.app.root_dir) | 78 rel_path = os.path.relpath(rendered_path, self.app.root_dir) |
77 raise TemplatingError(msg, rel_path) from ex | 79 raise TemplatingError(msg, rel_path) from ex |
78 | 80 |
79 def _getTemplatingError(self, tse, filename=None): | 81 def _getTemplatingError(self, tse, filename=None): |