app.py 文件源码

python
阅读 18 收藏 0 点赞 0 评论 0

项目:annotated-py-flask 作者: hhstore 项目源码 文件源码
def handle_exception(self, e):
        """Default exception handling that kicks in when an exception
        occours that is not catched.  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
        """
        handler = self.error_handlers.get(500)
        if self.debug:
            raise
        self.logger.exception('Exception on %s [%s]' % (
            request.path,
            request.method
        ))
        if handler is None:
            return InternalServerError()
        return handler(e)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号