Skip to main content

Module exit

Module exit 

Source
Expand description

Bespoke Unix exit codes per error code.

Most aube errors exit with the generic EXIT_GENERIC (1). A curated subset — the ones a CI script or shell pipeline most often wants to branch on — gets its own exit code so callers can react without parsing stderr.

Exit codes are declared inline on each crate::CodeMeta entry in crate::errors::ALL; this module just provides the lookup.

The 8-bit exit-code space is lean (POSIX reserves several values 126–165 for shell signals), so codes are allocated in 10-wide ranges by category, with room to grow:

rangecategory
1generic / unknown error
2CLI usage error
10–19lockfile
20–29resolver
30–39tarball / store
40–49registry / network
50–59scripts / build
60–69linker
70–79manifest / workspace
80–89engine / cli surface
90–99misc / safety

Tooling consumers should branch on the exit code rather than the exit category, since the categories are documentation, not API.

Constants§

EXIT_CLI_USAGE
CLI usage error — bad flags, conflicting options, missing required arguments. Reserved as a convention, not currently emitted by aube itself (clap exits with this code on its own).
EXIT_GENERIC
Generic catch-all. Anything not explicitly assigned an exit code in crate::errors::ALL resolves to this exit code.

Functions§

exit_code_for
Returns the bespoke exit code for code, or None if the code has no bespoke entry (the caller should use EXIT_GENERIC).