Behaviour if errors during Renderer.run()
Bug #1169217 reported by
Luc Saffre
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Appy |
Fix Released
|
Medium
|
Luc Saffre |
Bug Description
When I run appy_pod.Renderer on a template which contains buggy instructions, then the resulting file contains the tracebacks as comments. Very well. But sometimes I'd prefer appy.pod to not catch such exceptions. E.g. when I run it within a unit test suite.
Changed in appy: | |
assignee: | nobody → Luc Saffre (luc-saffre) |
Changed in appy: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
Please find attached an almost-solution.
I added an option CATCH_ERRORS which is True by default, leading to the normal behaviour.
If it is False, exceptions catched during execute() or evaluateBuffer() are simply re-raised. Result is exactly what I wanted.
This is even much simpler than the first approach which we agreed upon.
One detail is missing though: CATCH_ERRORS is a global constant because I didn't find out how to access the Renderer from within a BufferAction instance. For me that's okay, but if you agree with my approach I suggest that you add a keyword option "catchErrors=True" to Renderer.__init__() and then somehow use this from within the BufferAction instead of the global CATCH_ERRORS.
Luc