地址地址地址
| 代码 | 状态 | 含义 |
|---|---|---|
| url_required | 400 | 没有提供地址。 |
| url_not_https | 400 | 直接在http上。 信物会无加密地行驶 。 |
| url_blocked | 400 | 它没有决心发表公开讲话。 |
| mcp_redirect | 502 | 服务器以重定向回应。 从未被跟踪, 目标从未检查 。 |
象征性
| 代码 | 状态 | 含义 |
|---|---|---|
| mcp_token_malformed | 400 | 里面有空间 仅贴上象征 |
| mcp_token_required | 401 | 服务器想要一个,但没有给。 |
| mcp_unauthorized | 401 | 被拒,旋转 update(). |
服务器服务器
| 代码 | 状态 | 含义 |
|---|---|---|
| mcp_unreachable | 502 | 完全没有答案 |
| mcp_timeout | 504 | 超过上限——30秒,60秒呼叫。 |
| mcp_http_error | 502 | 拒绝在 HTTP 级别。 |
| mcp_bad_response | 502 | 答案不是可读协议信息。 |
| mcp_error | 502 | 协议错误 。 服务器的邮件已携带 。 |
| mcp_protocol_unsupported | 502 | 没有共同的修订。 |
mcp_error 携带服务器的单词
其内容是阅读而非解释:不管服务器操作者是谁,都写了这个信息,通常写出真实原因——缺少能力、没有支持的版本、与身体不匹配的页眉。
处理
import { IaGenifyError } from "iagenify";
try {
await api.mcp.call("example", "search_docs", { query });
} catch (err) {
if (!(err instanceof IaGenifyError)) throw err;
switch (err.code) {
case "mcp_unauthorized": return rotateToken();
case "mcp_timeout":
case "mcp_unreachable": return markServerDown();
default: throw err;
}
}from iagenify import IaGenifyError
try:
api.mcp.call("example", "search_docs", {"query": query})
except IaGenifyError as error:
if error.code == "mcp_unauthorized":
rotate_token()
elif error.code in ("mcp_timeout", "mcp_unreachable", "mcp_http_error"):
mark_server_down()
else:
raise最后一个被记住
A连接保持 lastError,因此一个服务器的标记过期或地址被移动的服务器显示在 (列表) 而不是仅仅在跑步中失败