comparison piecrust/rendering.py @ 574:bc23465ed1b4

bug: Fix a crash when some errors occur during page rendering.
author Ludovic Chabant <ludovic@chabant.com>
date Sat, 19 Dec 2015 18:05:28 -0800
parents 094bdf2f7c4c
children 683be25cbdb2
comparison
equal deleted inserted replaced
573:a489162f2a17 574:bc23465ed1b4
277 if layout_result['pass_info'] is not None: 277 if layout_result['pass_info'] is not None:
278 rp.render_info[PASS_RENDERING] = RenderPassInfo._fromJson( 278 rp.render_info[PASS_RENDERING] = RenderPassInfo._fromJson(
279 layout_result['pass_info']) 279 layout_result['pass_info'])
280 return rp 280 return rp
281 except Exception as ex: 281 except Exception as ex:
282 page_rel_path = os.path.relpath(page.path, ctx.app.root_dir) 282 page_rel_path = os.path.relpath(ctx.page.path, ctx.app.root_dir)
283 raise Exception("Error rendering page: %s" % page_rel_path) from ex 283 raise Exception("Error rendering page: %s" % page_rel_path) from ex
284 finally: 284 finally:
285 ctx.setCurrentPass(PASS_NONE) 285 ctx.setCurrentPass(PASS_NONE)
286 eis.popPage() 286 eis.popPage()
287 287