#11368: debug error reporter should include traceback for nested exceptions
----------------------------+-----------------------------------------------
 Reporter:  jfire           |       Owner:  nobody    
   Status:  new             |   Milestone:            
Component:  Core framework  |     Version:  1.0       
 Keywords:                  |       Stage:  Unreviewed
Has_patch:  0               |  
----------------------------+-----------------------------------------------
 There are a number of place in the django codebase that trap Exception and
 then raise a new exception. This results in less-than-ideal debugging
 information being presented in the default error page; in particular, the
 traceback from the original exception is unavailable.

 Most recently, I encountered this in the template renderer:

 {{{
 class DebugNodeList(NodeList):
     def render_node(self, node, context):
         try:
             result = node.render(context)
         except TemplateSyntaxError, e:
             if not hasattr(e, 'source'):
                 e.source = node.source
             raise
         except Exception, e:
             from sys import exc_info
             wrapped = TemplateSyntaxError(u'Caught an exception while
 rendering: %s' % force_unicode(e, errors='replace'))
             wrapped.source = node.source
             wrapped.exc_info = exc_info()
             raise wrapped
         return result
 }}}

 When this wrapped TemplateSyntaxError is displayed in the default error
 page, the traceback ends at the 'raise wrapped' line; the only part of the
 original exception that is available is the message ("'RelatedManager'
 object is not iterable" in my current case). This makes the source of the
 problem more difficult to determine. The traceback in wrapped.exc_info
 should be displayed in addition to, or instead of, the traceback currently
 displayed.

 This was briefly [http://groups.google.com/group/django-
 developers/browse_thread/thread/9d36bba7fc2ffa62/c489cc9745ef8de8
 discussed] (exactly 1 year ago) on django-developers. A
 [http://code.djangoproject.com/attachment/ticket/6537/6537.diff partial
 patch] was posted.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/11368>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to