Skip to main content

Module codes

Module codes 

Source
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.

ClassCodesExit codeMeans
usageSH0nnn2the arguments or the input are wrong: change the command
setupSH1nnn3the project file or the toolchain needs fixing: fix it, then run the same command again
contentSH2nnn1a file of the game’s content has a problem
operationSH3nnn1the 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: SH and four digits, never reused or renumbered (ADR-0028). The content codes are in codes; the tools’ own are in shuyi_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 (or web --release) found a path of the build machine in the built program, and refused the package.
DISCLOSURE
disclosure: export found what the game’s disclosure part doesn’t allow in the final package, and removed it.
ENGINE_DEPENDENCY
engine-dependency: the game’s Cargo.toml has no shuyi dependency, 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’s check-keys).
LINK_LOST
link-lost: the build’s link is held by another client, closed, or answered what attach can’t read.
LINK_TOKEN
link-token: attach gave a token the build doesn’t have, and it closed the link.
LINK_VERSION
link-version: the build speaks another link version than this shuyi.
NOT_OFFERED
not-offered: the game’s tools don’t offer the operation.
NO_BUILD
no-build: attach found 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: no shuyi.ron here or above.
NO_SESSION
no-session: an MCP session tool was called with no game started.
NO_VALUE
no-value: scene --path was given a JSON Pointer that names nothing in the scene’s data.
OTHER_STAMP
other-stamp: replay was 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.ron doesn’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’s check-text).
TARGET
target: no such target, or the target profiles don’t load.
TARGET_CHECK
target-check: export ran 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: add was 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: one help[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 its help (multi-line help indented under it) and the shuyi explain that prints its page.