AS AgentScopeAPI 手册 / API Reference
类class agentscope.app.channel

ChannelError

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
messagestr消息(类型 `str`)。The human-readable error.
status_code默认default 400int状态 code(类型 `int`)。The HTTP status the router should return.
源码Source agentscope/app/channel/_errors.py:14–23
基于官方固定版本源码静态生成Generated from pinned official sources · Python 2.0.11 · Java 2.0.4
签名与文档为静态抽取;如有疑问请以源码为准。Signatures and docs are extracted statically; verify against the source when in doubt.