错误目录

每个 trustmint 工厂表面错误都是在 application/problem+json 主体中返回的稳定 THM-NNNNN 代码。此页面是前门 - 权威的机器可读目录位于存储库中并且是生成的,因此此页面链接它而不是复制它。

事实来源(请勿手工编辑)

产物

用途

thingmake-error-catalog.md

人类可读的代码参考(每个代码:状态、标题、描述)

thingmake-error-catalog.json

机器可读的形式——SDK 类型错误表面是由什么生成的

两者都是由 services/thingmake/cmd/error-catalog-gen 从 services/thingmake/internal/api/errorTable 生成。 CI 漂移门拒绝任何手动编辑。如果您认为代码错误,请修复源表,而不是目录。

THM-NNNNN代码方案

代码按域存储:前导数字标识存储桶,因此 THM-2xxxx 是工厂验证,THM-5xxxx 是状态更改源,依此类推。权威的存储桶列表是目录的预订表 - 存储桶是生成的并且集合会增长,因此请阅读目录而不是记住计数。

在撰写本文时,目录保留了以下域存储桶:

类别

领域

交叉引用

1

foundation-auth

注册 上的 JWT 不记名身份验证

2

factory-auth

AK/SK签约注册

3

registrar-lifecycle

注册器批准/配置运行

4

thing-state-machine

非法转换/错误状态(事物生命周期)

5

state-changes-feed

webhooks 上的光标轮询

6

subscriptions

webhooks 上的 webhook 订阅规则

7

identity-blacklist

/provisioning/v1/identity-blacklist* 端点组

8

trust-anchor

信锚发货 至工厂后台

9

内部跨域保留

保留(尚无公共代码)

Bucket 2 — factory-auth covers inbound dispatch credential verification on every non-registration call (see registration). The dispatch credential is a Phase 45 workload-identity Bearer (an RS256 JWT carrying iss, aud, exp and a kid), verified against the DotID token-exchange JWKS — it is no longer an FGAI-HMAC-SHA256 signature. The codes are unchanged; what each one now means is:

代码

DotID 故障模式

THM-20110

MISSING_HEADER — no Authorization header at all

THM-20120

INVALID_SIGNATURE — the token does not verify, or does not bind here (aud is another factory, iss is not the realm, the signing algorithm is not an allowed RSA variant)

THM-20130

EXPIRED — exp is in the past beyond the verifier's clock-skew leeway

THM-20140

UNKNOWN_KEY — the presented kid resolves to no key in the trusted JWKS. (This is what an unregistered access-key id became: same fact about the caller — you presented a key I do not know — so it keeps the same code.)

THM-20150

REPLAY — NOT EMITTED on the dispatch face. See below.

⚠️ THM-20150 no longer applies to inbound dispatches, and its absence is deliberate. A Bearer is replayable by construction: it authorises many calls to its audience and resource for its whole lifetime, so a legitimate second dispatch and a replay are the same bytes in the same position and no predicate separates them. Refusing on reuse would refuse valid traffic. Replay is therefore bounded rather than refused — short token TTL plus aud/resource binding — and reuse is recorded (not rejected) for audit. Do not treat a successful re-send of the same token as a contract violation, and do not expect THM-20150 on this path. The code remains in the catalog; it is simply not produced here.

THM-20100 (factory-auth-failed) 是未分类签名失败的通用后备方案。这些代码是稳定的;该映射是一种导航辅助工具——权威描述位于生成的目录中。

Two codes in this bucket are 503, not 401, because your credential was never evaluated. Do not re-sign in response to either:

代码

Meaning

What to do

THM-20210

the signature verifier could not be reached

retry after a short backoff

THM-20220

the service's own credential to the verifier was refused

report it — this is a server-side defect, not yours

存储桶 7 — Identity-blacklist 支持 /provisioning/v1/identity-blacklist* 端点组(请参阅 API 参考)。其代码涵盖黑名单查找(THM-70100)、增量游标处理(THM-70110 格式错误、THM-70120 早于72h → 完全同步)和快照未就绪(THM-70130)。

桶 8 — 信任锚 支持 ACTIVATE saga 分支上的信任锚传递。其代码为 THM-TRUST-ANCHOR-FETCH-FAILED (503)、THM-TRUST-ANCHOR-MALFORMED (502) 和 THM-TRUST-ANCHOR-REJECTED (422)。参见信锚交付§5。

该表是一个导航辅助工具,不是事实来源:如果在上游添加存储桶,它会首先出现在目录的预订表中。始终对照 thingmake-error-catalog.md 进行确认。

SDK 如何使用它

两个 SDK 均附带由 thingmake-error-catalog.json 构建的生成的类型错误表面。在任何 4xx/5xx 上,它们解析问题主体,查找 THM-NNNNN 代码,并返回类型错误(Go 中的 errors.Is(err, thingmake.ErrCode...),Python 中的 except ...Error)。参见SDK快速入门。