how to debug templates

Asked by Luc Saffre on 2011-02-06

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:
2011-02-06
Last query:
2011-02-06
Last reply:
2011-02-06

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

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

Luc Saffre (luc-saffre) said : #3

Thanks Gaëtan Delannay, that solved my question.