#21536: the handler swallows exception
--------------------------------------+--------------------
     Reporter:  wuhaochi@…            |      Owner:  nobody
         Type:  Cleanup/optimization  |     Status:  new
    Component:  Core (Other)          |    Version:  1.6
     Severity:  Normal                |   Keywords:
 Triage Stage:  Unreviewed            |  Has patch:  0
Easy pickings:  0                     |      UI/UX:  0
--------------------------------------+--------------------
 line /Library/Python/2.7/site-
 packages/Django-1.6-py2.7.egg/django/core/handlers/base.py : 197.
 the code is this:

 {{{
         except: # Handle everything else.
             # Get the exception info now, in case another exception is
 thrown later.
             signals.got_request_exception.send(sender=self.__class__,
 request=request)
             response = self.handle_uncaught_exception(request, resolver,
 sys.exc_info())
 }}}

 And this haunted me quite a while when I just made a syntax mistake in my
 view function. Since I was reported "Server Error 500 27"
 Internal Server error. But why?
 When I add this block, I find the answer of my error.

 {{{
       except Exception as e:
             import traceback
             traceback.print_exc(e)

         except: # Handle everything else.
             # Get the exception info now, in case another exception is
 thrown later.
             signals.got_request_exception.send(sender=self.__class__,
 request=request)
             response = self.handle_uncaught_exception(request, resolver,
 sys.exc_info())
 }}}

-- 
Ticket URL: <https://code.djangoproject.com/ticket/21536>
Django <https://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 unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/061.dc4c0a454ed2dffa1b3661862709323f%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to