Django hiding exceptions
|Reported by:||richard@…||Owned by:||russellm|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
I just got an exception "TemplateSyntaxError: Caught an exception while rendering." Looking into the code where that exception was being raised, I see that it's actually squashing another exception (anything with subclass Exception) and re-raising the useless message I got.
I eventually narrowed down the code that was raising the initial exception, and put my own try/except block around it, and found that the exception really being raised is at result of passing an invalid value to an object constuctor (a meta.Model object, this is). Clearly *not* a template syntax error.
Please don't squash exceptions.
The offending (offensive?) code is the "wrapped" section of DebugNodeList in django/core/template/init.py (currently terminating on line 742).
Change History (7)
comment:1 Changed 10 years ago by russellm
- Owner changed from adrian to russellm
- Status changed from new to assigned