类class
agentscope.app.channelChannelError
class ChannelError(Exception)
源码Source
agentscope/app/channel/_errors.py:5–23渠道错误,把智能体接入外部消息渠道与企业平台。位于 agentscope.app.channel 包,继承自 Exception。
Carries the HTTP status the router should surface, so one exception
covers every case (not-found → 404, duplicate bot → 409, bad request
→ 400) without a subclass per case — the router reads
:attr:status_code and the message.
构造器摘要Constructor Summary
| 构造器Constructor | 说明Description |
|---|---|
def __init__(message: str, status_code: int = 400) -> None | 初始化 `ChannelError` 实例。 Bind the error message and the HTTP status to surface. |
构造器详情Constructor Detail
ChannelError
def __init__(message: str, status_code: int = 400) -> None
初始化 ChannelError 实例。
Bind the error message and the HTTP status to surface.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
message | str | 消息(类型 `str`)。The human-readable error. |
status_code默认default 400 | int | 状态 code(类型 `int`)。The HTTP status the router should return. |
源码Source
agentscope/app/channel/_errors.py:14–23