Enable AttributeError reporting in template rendering
|Reported by:||Nebojsa Djordjevic <nesh at studioquattro dot co dot yu>||Owned by:||Adrian Holovaty|
|Cc:||nesh@…||Triage Stage:||Design decision needed|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
This bugs me a while.
When exception is thrown inside model function not traceback or any indication is given (with DEBUG=True), for example
class Foo(models.Model) def bar(self): raise SomeException()
will return nothing (None) with *no indication* that error is occurred! Which leads to mysterious errors or missing data
without any indication what is happened.
So I got accustomed to write something like this:
class Foo(models.Model) def bar(self): try: raise SomeException() except Exception, err: return str(err)
to, at least, get some indication (as a text returned from function) when error is occurred.
Any solutions or plans for this?
Change History (6)
comment:2 Changed 11 years ago by
|Summary:||Exceptions inside model functions → Exceptions inside functions called from templates|
comment:3 Changed 11 years ago by
|Component:||Core framework → Template system|
|Summary:||Exceptions inside functions called from templates → Enable AttributeError reporting in template rendering|