本文整理汇总了Python中tornado.httpclient.HTTPError.__traceback__方法的典型用法代码示例。如果您正苦于以下问题:Python HTTPError.__traceback__方法的具体用法?Python HTTPError.__traceback__怎么用?Python HTTPError.__traceback__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tornado.httpclient.HTTPError
的用法示例。
在下文中一共展示了HTTPError.__traceback__方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: handle_exception
# 需要导入模块: from tornado.httpclient import HTTPError [as 别名]
# 或者: from tornado.httpclient.HTTPError import __traceback__ [as 别名]
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