Mercurial > piecrust2
changeset 715:a14371c5cda7
debug: Pass the exceptions untouched when debugging.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Thu, 26 May 2016 20:45:16 -0700 |
parents | e4dcef2d5640 |
children | 42efc3634763 |
files | piecrust/rendering.py piecrust/templating/jinjaengine.py |
diffstat | 2 files changed, 4 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/piecrust/rendering.py Thu May 26 20:44:44 2016 -0700 +++ b/piecrust/rendering.py Thu May 26 20:45:16 2016 -0700 @@ -225,6 +225,8 @@ layout_result['pass_info']) return rp except Exception as ex: + if ctx.app.debug: + raise logger.exception(ex) page_rel_path = os.path.relpath(ctx.page.path, ctx.app.root_dir) raise Exception("Error rendering page: %s" % page_rel_path) from ex
--- a/piecrust/templating/jinjaengine.py Thu May 26 20:44:44 2016 -0700 +++ b/piecrust/templating/jinjaengine.py Thu May 26 20:45:16 2016 -0700 @@ -58,6 +58,8 @@ except AbortedSourceUseError: raise except Exception as ex: + if self.app.debug: + raise msg = "Error rendering Jinja markup" rel_path = os.path.relpath(path, self.app.root_dir) raise TemplatingError(msg, rel_path) from ex