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


Python httpclient.HTTPError类代码示例

本文整理汇总了Python中tornado.httpclient.HTTPError的典型用法代码示例。如果您正苦于以下问题:Python HTTPError类的具体用法?Python HTTPError怎么用?Python HTTPError使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: handle_exception

    def handle_exception(self, typ, error, tb):
        if isinstance(error, _RequestTimeout):
            if self._stream_ended:
                self.finish()
                return True
            else:
                error = HTTPError(599, "Timeout")

        self._remove_timeout()
        self._unregister_unfinished_streams()
        if hasattr(self, "stream_id"):
            self.context.remove_stream_delegate(self.stream_id)

            # FIXME: our nginx server will simply reset stream,
            # without increase the window size which consumed by
            # queued data frame which was belongs to the stream we're resetting
            # self.context.reset_stream(self.stream_id, flush=True)
            self.context.reset_stream_ids.append(self.stream_id)

        error.__traceback__ = tb
        response = HTTP2Response(self.request, 599, error=error, request_time=self.io_loop.time() - self.start_time)
        self._run_callback(response)
        return True
开发者ID:mSOHU,项目名称:http2,代码行数:23,代码来源:tornado4.py

示例2: __init__

 def __init__(self, errno, message):
     HTTPError.__init__(self, 599, message)
     self.errno = errno
开发者ID:Benozo,项目名称:catawampus,代码行数:3,代码来源:curl_httpclient.py

示例3: __init__

 def __init__(self, errno: int, message: str) -> None:
     HTTPError.__init__(self, 599, message)
     self.errno = errno
开发者ID:bdarnell,项目名称:tornado,代码行数:3,代码来源:curl_httpclient.py

示例4: __init__

 def __init__(self, status_code, user_message, log_message=None, *args):
     HTTPError.__init__(self, status_code, log_message, *args) 
     self.user_message = user_message 
开发者ID:uve,项目名称:shiva,代码行数:3,代码来源:sw_base.py


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