mint._exceptions
改编自 Tinker SDK(Apache-2.0)
参考文档改编自 Tinker SDK,已为 Mint Recursive 做了调整。详见归属说明与 Apache 2.0 许可。
Mint Recursive SDK 的异常层级。所有异常都继承自 TinkerError。
TinkerError
├── APIError
│ ├── APIResponseValidationError
│ ├── APIStatusError
│ │ ├── BadRequestError (400)
│ │ ├── AuthenticationError (401)
│ │ ├── PermissionDeniedError (403)
│ │ ├── NotFoundError (404)
│ │ ├── ConflictError (409)
│ │ ├── UnprocessableEntityError (422)
│ │ ├── RateLimitError (429)
│ │ └── InternalServerError (500+)
│ └── APIConnectionError
│ └── APITimeoutError
├── SidecarError
│ ├── SidecarStartupError
│ ├── SidecarDiedError
│ └── SidecarIPCError
└── RequestFailedError
| 异常 | 基类 | 说明 |
|---|---|---|
TinkerError |
Exception |
所有 Mint Recursive 相关错误的基类。 |
APIError |
TinkerError |
所有 API 相关错误的基类。 |
APIResponseValidationError |
APIError |
API 响应与预期 schema 不匹配时抛出。 |
APIStatusError |
APIError |
API 响应状态码为 4xx 或 5xx 时抛出。 |
APIConnectionError |
APIError |
发起 API 请求时出现连接错误时抛出。 |
APITimeoutError |
APIConnectionError |
API 请求超时时抛出。 |
BadRequestError |
APIStatusError |
HTTP 400:请求无效或格式错误。 |
AuthenticationError |
APIStatusError |
HTTP 401:缺少身份凭证或凭证无效。 |
PermissionDeniedError |
APIStatusError |
HTTP 403:权限不足以访问该资源。 |
NotFoundError |
APIStatusError |
HTTP 404:请求的资源不存在。 |
ConflictError |
APIStatusError |
HTTP 409:请求与资源当前状态冲突。 |
UnprocessableEntityError |
APIStatusError |
HTTP 422:请求格式正确但存在语义错误。 |
RateLimitError |
APIStatusError |
HTTP 429:请求过多,超出速率限制。 |
InternalServerError |
APIStatusError |
HTTP 500+:服务端发生错误。 |
SidecarError |
TinkerError |
子进程 sidecar 错误的基类。 |
SidecarStartupError |
SidecarError |
sidecar 子进程启动失败或超时时抛出。 |
SidecarDiedError |
SidecarError |
sidecar 子进程在有请求待处理时意外退出时抛出。 |
SidecarIPCError |
SidecarError |
与 sidecar 子进程通信失败时抛出。 |
RequestFailedError |
TinkerError |
异步请求以失败状态完成时抛出。 |