how to debug templates

Asked by Luc Saffre

I noticed that when there are errors in my template there is no Exception risen. The resulting odt document still gets generated and contains the error messages. That's ok. But is there a way to see these error messages also when the result format is .pdf? Until now I used the workaround to change my application's configuration so that it generates .odt files while I am debugging a template, and when everything is ok I switch back to .pdf format. Is there another possibility?

Luc

Question information

Language:
English Edit question
Status:
Solved
For:
Appy Edit question
Assignee:
No assignee Edit question
Solved by:
Gaëtan Delannay
Solved:
Last query:
Last reply:
Revision history for this message
Best Gaëtan Delannay (gaetan-delannay) said :
#1

Hi Luc,
For the moment there is indeed no other possibility. Errors are generated in the ODT and are lost in the PDF.
What I could add in some undefined future is a "debug" mode where exceptions would really be raised instead of being dumped in the resulting ODT as a note.
Cheeeeers
Gaetan

Revision history for this message
Luc Saffre (luc-saffre) said :
#2

Thanks. That answers my question!

I would not advise to add a "debug mode where exceptions would really be raised". At least I don't see how that would help. Rather log errors (either by using the logging module or by having the user pass an optional parameter 'errorlog' which should be any object that has a `write` method).

Luc

Revision history for this message
Luc Saffre (luc-saffre) said :
#3

Thanks Gaëtan Delannay, that solved my question.