Skip to content

docs(error-codes): expand error code reference with ~70 new codes and actionable solutions#361

Open
rcsh1 wants to merge 1 commit into
CoboGlobal:masterfrom
rcsh1:error-codes-expansion
Open

docs(error-codes): expand error code reference with ~70 new codes and actionable solutions#361
rcsh1 wants to merge 1 commit into
CoboGlobal:masterfrom
rcsh1:error-codes-expansion

Conversation

@rcsh1

@rcsh1 rcsh1 commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

Intent

当前错误码文档覆盖度不够,并且没有充分写明错误原因和解决方法。

Summary

  • Restructured snippets/error-codes.mdx and snippets/error-codes-cn.mdx from a single flat table into 12 functional sections
  • Added ~70 previously undocumented error codes sourced directly from custody/waas2 exception classes (transfer.py, exceptions.py, compliance/exceptions.py, travel_rule.py, mfa/exception.py, mpc/exceptions.py, evm_infra/exceptions.py, category/exceptions.py, data/exceptions.py)
  • All solutions rewritten to explain WHY the error occurs and list only actions the developer can take
  • Solutions for codes with a fixed valid set enumerate values from code (e.g. 60002: Transfer, ContractCall, MessageSign)
  • CN file: Fee Station, Vault kept in English per bilingual glossary; API field names and enum values untranslated throughout

Test plan

  • mintlify validate passes (same single pre-existing warning as master — unrelated missing autosweep file)
  • Spot-check EN and CN sections render correctly in local dev server
  • Verify pending confirmations below are resolved before merging

… actionable solutions

- Restructured EN and CN error-codes snippets from a single flat table
  into 12 functional sections (general, pricing, wallet config, transfer,
  token/balance, transaction management, MPC, EVM, MFA, categories,
  compliance/KYT, Travel Rule)
- Added ~70 previously undocumented error codes sourced from custody/waas2
  exception classes (transfer.py, exceptions.py, compliance/exceptions.py,
  travel_rule.py, mfa/exception.py, mpc/exceptions.py, evm_infra/exceptions.py,
  category/exceptions.py, data/exceptions.py)
- All solutions rewritten to explain WHY the error occurs and describe only
  actions the developer can take; solutions that restated the error or described
  server-side states removed
- Solutions for codes with fixed valid sets enumerate them from code
  (e.g. 60002: Transfer, ContractCall, MessageSign)
- UTXO locking mechanism explained for 2105; balance calculation explained
  for 30012; token threshold API links added for 30010/30011
- Exchange Wallet Observation mode (30035) identified precisely
- CN file: Fee Station, Vault kept in English per bilingual glossary;
  API field names and enum values untranslated throughout
@rcsh1

rcsh1 commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator Author

⚠️ 待确认事项 — 合并前请逐项确认

1. 钱包名称字符上限(错误码 2101)

waas2/base/exceptions/exceptions.py 中的错误消息模板为:

WALLET_NAME_OUT_OF_LIMIT: _("Wallet name cannot exceed {limit} characters.")

{limit} 在调用处动态注入,未在异常类中硬编码。当前文档使用的是"最大允许字符长度"这一泛化表述,未给出具体数值。请在 custody/waas2 中找到所有调用 WALLET_NAME_OUT_OF_LIMIT 的位置,确认 limit= 参数的实际值,并更新文档中的对应条目。


2. 错误码 40001–40003 存在重复

两个不同的异常类使用了相同的错误码,但含义不同:

错误码 CategoryAPIException EvmInfraException
40001 团队不存在 EVM 速率限制已达到
40002 类别数量超限 合约源代码未验证
40003 类别名称已存在 链不支持

当前文档已将两组错误码分别放在不同章节中,并附有章节级上下文说明。请确认此重复是否为预期设计,以及文档中是否需要额外说明,或者其中一个异常类是否应重新编号。


3. 合规与 KYT 错误(40101–40126)解决方案准确性待确认

这 26 条合规/KYT 错误码的解决方案均根据异常消息字符串和类级上下文推导而来,尚未经过实际合规工作流的验证。建议合规产品团队在合并前审阅此部分,重点关注:

  • 40108、40113:当前方案均为"确认请求参数正确后重试",但尚不确定重试是否为正确处理方式,或是否需要其他操作。
  • 40115–40118:涉及手续费和地址校验的错误 — 相关参数名称及有效值请对照 KYT API 规范确认。

@cobosteven

Copy link
Copy Markdown
Collaborator

🤖 自动化文档 Review — doc-pr-review playbook

doc-pr-review playbook 生成(codex 引擎),对照 custody / cobo-libs 源码做了双向事实核验。非阻塞评论,仅供参考。

Verdict: REQUEST_CHANGES

总体

覆盖度扩展到位,事实核验未发现伪造或错误的错误码(逐码对照源码,如 cobo_libs/api/exceptions.pybase_api.py:125-134 等均有 file:line 依据)。阻塞点在文档质量:多条 solution 不可执行、复述错误当解法、缺枚举/约束值;另有若干 CN 术语问题。

Must-fix(合规阻塞)

  • 不可执行的 solution — 1003/2003、1006/2006、2000、2021、2026、2028、2029、10000、2050-2054、2101-2105:把"提供合法参数/稍后重试/检查权限/购买套餐"换成具体 Cobo Portal 点击路径完整 API/curl 操作;限流/资源类补可运行的 list-get / 重试流程。
  • 复述错误当解法 — 1003/2003、1006/2006、2101、2102、2103:需指明确切的非法/缺失字段、合法约束来源、重试前的具体动作。
  • 2029 status 允许值未枚举:若是固定 enum 则从代码列出,否则指明 operation 级的权威来源。
  • 2101 / 2102:补钱包名最大长度(2101)与完整字符规则(2102)。
  • 2104:链启用给出确切 Portal 路径或验证已启用链的 API/curl。
  • 10000:组织只读访问需给出确切 Portal 导航/设置项,并说明仅 team admin 可改。

Should-fix(双语术语 / 因果说明)

  • 应保留英文却被翻译Main Group→主控组(30032)、Signing Group→签名组(50000)、app check→应用检查(40125);按双语词表保留英文。
  • EN/CN 漂移:30012/12007 EN "reserved" vs CN "locked amounts" → CN 统一为 预留金额
  • 70004/70012 Travel Rule 术语 EN/CN 对齐(natural person entity)。
  • 2050-2054 计费类补因果(套餐未激活 / 配额 / 权益 / 欠费 / 需升级)与确切账单路径。
  • 2021/2026/2028/2105 给出更具体的请求形状校验、重试退避、资源查询;2105 补"查询锁 UTXO 的 pending 交易 + 释放 UTXO 的终态"完整查询。

Nits

  • 2024/2025:CN 用 API key 大小写、UI 标签加粗而非直引号。

事实核验为单引擎(codex)运行结果,建议合并前人工复核 must-fix 项。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants