Expand description
Problem codes (ADR-0028): every error the contract gives carries a
stable code, SH and four digits, whose first digit is its class, and
the class sets the exit code. Each code has a row here, with a help
line, and a page in crates/cli/errors/ that shuyi explain <code>
prints.
| Class | Codes | Exit code | Means |
|---|---|---|---|
| usage | SH0nnn | 2 | the arguments or the input are wrong: change the command |
| setup | SH1nnn | 3 | the project file or the toolchain needs fixing: fix it, then run the same command again |
| content | SH2nnn | 1 | a file of the game’s content has a problem |
| operation | SH3nnn | 1 | the operation failed on something else: the game’s tools, a target, a file it reads or writes |
A code is never reused or renumbered: a retired one keeps its row and
its page. A new error gets a new code, its row and its page in the same
change. The content codes of the game’s files are
shuyi_assets::error::codes; those of its code, SH21nn (lint), and
the tools’ own are here.
Structs§
- Code
- A problem code:
SHand four digits, never reused or renumbered (ADR-0028). The content codes are incodes; the tools’ own are inshuyi_cli::contract::codes. - Entry
- A code’s row, read field by field (ADR-0039).
Enums§
- Class
- A code’s class: what kind of fix it asks for.
Constants§
- BUILD_
PATH build-path:export(orweb --release) found a path of the build machine in the built program, and refused the package.- DISCLOSURE
disclosure:exportfound what the game’sdisclosurepart doesn’t allow in the final package, and removed it.- ENGINE_
DEPENDENCY engine-dependency: the game’sCargo.tomlhas noshuyidependency, or the engine checkout it names can’t be read.- FILE
file: a file the operation reads or writes can’t be.- GAME_
ERROR game-error: the game’s tools failed.- GAME_
PROGRAM game-program: the game’s tool program didn’t build, or stopped before it answered.- HARD_
CODED_ KEY hard-coded-key: the game’s code or text names a key (lint’scheck-keys).- LINK_
LOST link-lost: the build’s link is held by another client, closed, or answered whatattachcan’t read.- LINK_
TOKEN link-token:attachgave a token the build doesn’t have, and it closed the link.- LINK_
VERSION link-version: the build speaks another link version than thisshuyi.- NOT_
OFFERED not-offered: the game’s tools don’t offer the operation.- NO_
BUILD no-build:attachfound no build listening at the address.- NO_
EXPORTER no-exporter: the target passes its check, but has no exporter, or no run step, yet.- NO_
PROJECT no-project: noshuyi.ronhere or above.- NO_
SESSION no-session: an MCP session tool was called with no game started.- NO_
VALUE no-value:scene --pathwas given a JSON Pointer that names nothing in the scene’s data.- OTHER_
STAMP other-stamp:replaywas given a record made by another engine, another build of the game or other content.- PACKAGE
package:export’s build, or writing its package, failed.- PROJECT_
FILE project-file:shuyi.rondoesn’t read, or lacks what the command needs.- RULES_
DEPENDENCY rules-dependency: the rules crate depends on a screen, device or tool crate, or on outside luck (lint).- RULES_
FENCE rules-fence: the rules crate uses what its fence bans: a hash map, a float, a clock, file I/O, outside luck (lint).- SCREEN_
TEXT screen-text: a screen’s text is written in its code, or a screen reads a data name itself (lint’scheck-text).- TARGET
target: no such target, or the target profiles don’t load.- TARGET_
CHECK target-check:exportran the target’s check, which found errors, and built nothing.- TOOLCHAIN
toolchain: a piece of the toolchain is missing or doesn’t start.- UNKNOWN_
MODULE unknown-module:addwas given a name that is no module the game’s engine builds.- WRONG_
ARGUMENTS wrong-arguments: the arguments or the input are wrong.
Statics§
- TABLE
- Every code, in order.
Functions§
- entry
- The row of
code. - exit_
code - The exit code of an error with
code: its class’s, 1 without one. - help_
lines - After a list of
problems: onehelp[CODE]: …line per code they used, in the order first used. - help_of
- The help line of
code’s row. - said
- An error of
name(an op or a command) for people:name: error[CODE]: message, then itshelp(multi-line help indented under it) and theshuyi explainthat prints its page.