当前位置: 首页>>代码示例>>Python>>正文


Python RequestHandler._handle_request_exception方法代码示例

本文整理汇总了Python中tornado.web.RequestHandler._handle_request_exception方法的典型用法代码示例。如果您正苦于以下问题:Python RequestHandler._handle_request_exception方法的具体用法?Python RequestHandler._handle_request_exception怎么用?Python RequestHandler._handle_request_exception使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在tornado.web.RequestHandler的用法示例。


在下文中一共展示了RequestHandler._handle_request_exception方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _handle_request_exception

# 需要导入模块: from tornado.web import RequestHandler [as 别名]
# 或者: from tornado.web.RequestHandler import _handle_request_exception [as 别名]
    def _handle_request_exception(self, exc):

        options = {
            "user": {"id": self.request.remote_ip},
            "context": self._get_context(),
            "request": {
                "url": self.request.full_url(),
                "method": self.request.method,
                "arguments": self.request.arguments,
            },
            "severity_reason": {
                "type": "unhandledExceptionMiddleware",
                "attributes": {
                    "framework": "Tornado"
                }
            }
        }

        # Notify bugsnag, unless it's an HTTPError that we specifically want
        # to ignore
        should_notify_bugsnag = True
        if type(exc) == HTTPError:
            ignore_status_codes = self.bugsnag_ignore_status_codes()
            if ignore_status_codes and exc.status_code in ignore_status_codes:
                should_notify_bugsnag = False

        if should_notify_bugsnag:
            bugsnag.auto_notify(exc, **options)

        # Call the parent handler
        RequestHandler._handle_request_exception(self, exc)
开发者ID:bugsnag,项目名称:bugsnag-python,代码行数:33,代码来源:__init__.py

示例2: _handle_request_exception

# 需要导入模块: from tornado.web import RequestHandler [as 别名]
# 或者: from tornado.web.RequestHandler import _handle_request_exception [as 别名]
    def _handle_request_exception(self, exc):
        # Set the request info
        bugsnag.configure_request(
            user_id=self.request.remote_ip,
            context=self._get_context(),
            request_data={
                "url": self.request.full_url(),
                "method": self.request.method,
                "arguments": self.request.arguments,
            },
        )

        # Notify bugsnag
        bugsnag.notify(exc)

        # Call the parent handler
        RequestHandler._handle_request_exception(self, exc)
开发者ID:8bitduck,项目名称:bugsnag-python,代码行数:19,代码来源:__init__.py

示例3: _handle_request_exception

# 需要导入模块: from tornado.web import RequestHandler [as 别名]
# 或者: from tornado.web.RequestHandler import _handle_request_exception [as 别名]
        def _handle_request_exception(self, exc):

            options = {
                "user": {"ip": self.request.remote_ip, "id": getattr(self, "current_user_id", 0)},
                "context": self._get_context(),
                "request": {
                    "url": self.request.full_url(),
                    "method": self.request.method,
                    "arguments": self.request.arguments,
                }
            }

            # Notify bugsnag, unless it's an HTTPError that we specifically want to ignore
            should_notify_bugsnag = True
            if type(exc) == HTTPError:
                if (exc.status_code<500 and exc.status_code>=400):
                    should_notify_bugsnag = False

            if should_notify_bugsnag:
                bugsnag.auto_notify(exc, **options)

            # Call the parent handler
            _RequestHandler._handle_request_exception(self, exc)
开发者ID:PegasusWang,项目名称:collection_python,代码行数:25,代码来源:__init__.py

示例4: _handle_request_exception

# 需要导入模块: from tornado.web import RequestHandler [as 别名]
# 或者: from tornado.web.RequestHandler import _handle_request_exception [as 别名]
    def _handle_request_exception(self, exc):

        options = {
            "user": {"id": self.request.remote_ip},
            "context": self._get_context(),
            "request": {
                "url": self.request.full_url(),
                "method": self.request.method,
                "arguments": self.request.arguments,
            },
        }

        # Notify bugsnag, unless it's an HTTPError that we specifically want to ignore
        should_notify_bugsnag = True
        if type(exc) == HTTPError:
            ignore_status_codes = self.bugsnag_ignore_status_codes()
            if ignore_status_codes and exc.status_code in ignore_status_codes:
                should_notify_bugsnag = False

        if should_notify_bugsnag:
            bugsnag.auto_notify(exc, **options)

        # Call the parent handler
        RequestHandler._handle_request_exception(self, exc)
开发者ID:kylef,项目名称:bugsnag-python,代码行数:26,代码来源:__init__.py

示例5: _handle_request_exception

# 需要导入模块: from tornado.web import RequestHandler [as 别名]
# 或者: from tornado.web.RequestHandler import _handle_request_exception [as 别名]
 def _handle_request_exception(self, e):
     if isinstance(e, NoResultFound):
         return self.error(404, "resource not found")
     RequestHandler._handle_request_exception(self, e)
开发者ID:rfw,项目名称:entranced,代码行数:6,代码来源:web.py

示例6: _handle_request_exception

# 需要导入模块: from tornado.web import RequestHandler [as 别名]
# 或者: from tornado.web.RequestHandler import _handle_request_exception [as 别名]
 def _handle_request_exception(self, e):
     RequestHandler._handle_request_exception(self,e)
     if self.settings.get('debug_pdb') and not isinstance(e, socket.error):
         import pdb
         pdb.post_mortem()
开发者ID:nod,项目名称:greeneggs,代码行数:7,代码来源:base.py

示例7: _handle_request_exception

# 需要导入模块: from tornado.web import RequestHandler [as 别名]
# 或者: from tornado.web.RequestHandler import _handle_request_exception [as 别名]
 def _handle_request_exception(self, e):
     if client:
         client.captureException()
     RequestHandler._handle_request_exception(self, e)
开发者ID:cnelsonsic,项目名称:SimpleMMO,代码行数:6,代码来源:baseserver.py


注:本文中的tornado.web.RequestHandler._handle_request_exception方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。