'Default exception handling that kicks in when an exception
occurs that is not caught.  In debug mode the exception will
be re-raised immediately, otherwise it is logged and the handler
for a 500 internal server error is used.  If no such handler
exists, a default 500 internal server error message is displayed.
.. versionadded:: 0.3'

def handle_exception(self, e):

    (exc_type, exc_value, tb) = sys.exc_info()
    got_request_exception.send(self, exception=e)
    handler = self._find_error_handler(InternalServerError())
    if self.propagate_exceptions:
        if (exc_value is e):
            reraise(exc_type, exc_value, tb)
        else:
            raise e
    self.log_exception((exc_type, exc_value, tb))
    if (handler is None):
        return InternalServerError()
    return self.finalize_request(handler(e), from_error_handler=True)
