From 8f89e0f26eebee149914e8ca20fe66669956544b Mon Sep 17 00:00:00 2001 From: nonebot Date: Thu, 3 Dec 2020 05:23:47 +0000 Subject: [PATCH] :memo: update api docs --- docs/api/exception.md | 65 +++++++++++++++++++++++++------------------ 1 file changed, 38 insertions(+), 27 deletions(-) diff --git a/docs/api/exception.md b/docs/api/exception.md index 42284e7e..26bd95a6 100644 --- a/docs/api/exception.md +++ b/docs/api/exception.md @@ -11,11 +11,22 @@ sidebarDepth: 0 这些异常并非所有需要用户处理,在 NoneBot 内部运行时被捕获,并进行对应操作。 -## _exception_ `IgnoredException` +## _exception_ `NoneBotException` 基类:`Exception` +* **说明** + + 所有 NoneBot 发生的异常基类。 + + + +## _exception_ `IgnoredException` + +基类:`nonebot.exception.NoneBotException` + + * **说明** 指示 NoneBot 应该忽略该事件。可由 PreProcessor 抛出。 @@ -31,7 +42,7 @@ sidebarDepth: 0 ## _exception_ `PausedException` -基类:`Exception` +基类:`nonebot.exception.NoneBotException` * **说明** @@ -49,7 +60,7 @@ sidebarDepth: 0 ## _exception_ `RejectedException` -基类:`Exception` +基类:`nonebot.exception.NoneBotException` * **说明** @@ -67,7 +78,7 @@ sidebarDepth: 0 ## _exception_ `FinishedException` -基类:`Exception` +基类:`nonebot.exception.NoneBotException` * **说明** @@ -85,7 +96,7 @@ sidebarDepth: 0 ## _exception_ `StopPropagation` -基类:`Exception` +基类:`nonebot.exception.NoneBotException` * **说明** @@ -102,7 +113,7 @@ sidebarDepth: 0 ## _exception_ `RequestDenied` -基类:`Exception` +基类:`nonebot.exception.NoneBotException` * **说明** @@ -121,9 +132,27 @@ sidebarDepth: 0 +## _exception_ `AdapterException` + +基类:`nonebot.exception.NoneBotException` + + +* **说明** + + 代表 `Adapter` 抛出的异常,所有的 `Adapter` 都要在内部继承自这个 `Exception` + + + +* **参数** + + + * `adapter_name: str`: 标识 adapter + + + ## _exception_ `ApiNotAvailable` -基类:`Exception` +基类:`nonebot.exception.AdapterException` * **说明** @@ -134,7 +163,7 @@ sidebarDepth: 0 ## _exception_ `NetworkError` -基类:`Exception` +基类:`nonebot.exception.AdapterException` * **说明** @@ -145,7 +174,7 @@ sidebarDepth: 0 ## _exception_ `ActionFailed` -基类:`Exception` +基类:`nonebot.exception.AdapterException` * **说明** @@ -158,21 +187,3 @@ sidebarDepth: 0 * `retcode: Optional[int]`: 错误代码 - - - -## _exception_ `AdapterException` - -基类:`Exception` - - -* **说明** - - 代表 Adapter 抛出的异常,所有的 Adapter 都要在内部继承自这个 Exception - - - -* **参数** - - - * `adapter_name: str`: 标识 adapter