Errors¶
Every failure reads CODE: What happened. Next step: What to do. The code is stable, so a script can branch on it; the next step says what a person can do now.
The full table of codes is generated from the contract into the README, one line for each. This page explains the shape and groups the codes by what they mean.
The shape¶
The code never carries a token, a body, a file's content or a URL query string. An error names the account, the operation and the class where one applies, and never the content that failed.
The groups¶
| Group | Codes | What it means |
|---|---|---|
| Sign-in | NEEDS_SIGN_IN, SCOPE_MISSING, GRANT_INVALID | the account's grant is missing, too narrow or spent |
| Accounts | ACCOUNT_REQUIRED, ACCOUNT_UNKNOWN, ACCOUNT_MISMATCH | the call named no alias, an unknown alias or another account's item |
| Input | INPUT_INVALID, SOURCE_UNKNOWN, SCHEMA_VIOLATION | the call does not match the method's schema or the answer does not match the contract's |
| Cursors | CURSOR_INVALID, CURSOR_EXPIRED | the cursor is malformed, belongs to another read, or its history is gone |
| Change gates | PLAN_INVALID, PLAN_USED, PERMISSION_DENIED | the plan is missing, expired, used or of another class, or a deny rule refused the call |
| Limits | RATE_LIMITED, BUDGET_EXCEEDED, TOO_LARGE, SOURCE_DISABLED | the provider asked to slow down, the read would cost more than allowed, the answer is too large or the source is off |
| Host | HOST_UNTESTED, OPTIONS_INVALID | OpenCode is outside the tested range, or the plugin's options do not match their schema |
| Provider | UNAVAILABLE | the provider or the gws process failed, or a guard refused the call |
Capabilities has the class of every method. Security has the plan and commit flow in full, and Troubleshooting has what to do for the common ones.