我已經使用webclient.Agent編寫了http下載程序。使用webclient.Agent時connectionLost中可能出現的異常有哪些?
使用reason參數調用body消費者對象的connectionLost函數。
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與錯誤描述...」語句。