feat: DAWN_Exxxx error-code registry — linkable, self-documenting failures#357
Merged
Conversation
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Co-Authored-By: Claude Opus 4.8 <[email protected]>
…x/permissions/model/tool-discovery) Co-Authored-By: Claude Opus 4.8 <[email protected]>
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Co-Authored-By: Claude Opus 4.8 <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
…es in the gated lanes
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Errors carried only a free-text
message+exitCode— nothing stable to search or link, and one site already hardcoded aDocs:URL inconsistently. This adds a central numeric error-code registry surfaced on all three error channels.What's new
@dawn-ai/sdk(errors.ts) — the leaf everyone depends on:DAWN_Exxxxcodes in ranges (E1xxx config · E2xxx sandbox · E3xxx permissions · E4xxx model/provider · E5xxx runtime/import), each{ code, title, docsPath? }. Codes are a literal union, so producers can't invent them.CliErrorgains an optionalcodeand the CLI prints[CODE] See <docs>; HTTP/SSE error bodies gaincode/docsUrl; permission denials returned as tool results are prefixed[DAWN_E3001].Docs:URL intool-discovery.tsis now centralized through the registry./docs/errorsreference page + a drift guard incheck-docs.mjs: everydocsPathmust resolve to a real page and/docs/errorsmust list exactly the registry's codes (negative-tested).Every message change is additive (an appended
[CODE]line or prefix), so no existing message assertion broke.docsPaths were reconciled to real pages —DAWN_E5001has no docs page yet, so itsdocsPathis omitted (a code without docs is valid).Full local verify green: build · typecheck (24/24) · lint (20/20) · test (1173 passed) · check-docs (+ new guard) · pack-check (8/8);
/docs/errorsrenders. Changeset: patch for@dawn-ai/{sdk,cli,core,sandbox,langchain}.Foundation for
dawn verify's preflight to emit codes (separate PR).🤖 Generated with Claude Code