異常?

源代碼: Lib/asyncio/exceptions.py


exception asyncio.TimeoutError?

A deprecated alias of TimeoutError, raised when the operation has exceeded the given deadline.

在 3.11 版更改: This class was made an alias of TimeoutError.

exception asyncio.CancelledError?

該操作已被取消。

取消asyncio任務(wù)時(shí),可以捕獲此異常以執(zhí)行自定義操作。在幾乎所有情況下,都必須重新引發(fā)異常。

在 3.8 版更改: CancelledError 現(xiàn)在是 BaseException 的子類。

exception asyncio.InvalidStateError?

TaskFuture 的內(nèi)部狀態(tài)無效。

在為已設(shè)置結(jié)果值的未來對(duì)象設(shè)置結(jié)果值等情況下,可以引發(fā)此問題。

exception asyncio.SendfileNotAvailableError?

"sendfile" 系統(tǒng)調(diào)用不適用于給定的套接字或文件類型。

子類 RuntimeError

exception asyncio.IncompleteReadError?

請(qǐng)求的讀取操作未完全完成。

asyncio stream APIs 提出

此異常是 EOFError 的子類。

expected?

預(yù)期字節(jié)的總數(shù)( int )。

partial?

到達(dá)流結(jié)束之前讀取的 bytes 字符串。

exception asyncio.LimitOverrunError?

在查找分隔符時(shí)達(dá)到緩沖區(qū)大小限制。

asyncio stream APIs 提出

consumed?

要消耗的字節(jié)總數(shù)。