# HG changeset patch # User Ludovic Chabant # Date 1464320716 25200 # Node ID a14371c5cda73484b61c1c628498e0f254d71595 # Parent e4dcef2d564088b0c530bcb8c6331698412c664b debug: Pass the exceptions untouched when debugging. diff -r e4dcef2d5640 -r a14371c5cda7 piecrust/rendering.py --- 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 diff -r e4dcef2d5640 -r a14371c5cda7 piecrust/templating/jinjaengine.py --- 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