【发布时间】:2012-11-14 11:10:16
【问题描述】:
我使用 webclient.Agent 编写了一个 http 下载器。
body消费者对象的connectionLost函数被调用一个reason参数。
def connectionLost(self, reason):
if isinstance(reason.value, ResponseDone):
self.df.callback(None)
else:
self.df.errback(reason.value)
我真的很想知道“原因”中可能的异常类是什么 因为我需要把它们全部捕获并在稍后的调用中处理它们 使用 inlineCallbacks 的函数。 到目前为止,我确定:
ConnectError, BindError, ConnectionClosed, ResponseFailed
这是否记录在某处? 大多数文档只包含模糊的 "...errback with a description of the error..." 语句。
【问题讨论】:
标签: python http twisted webclient