Skip to main content

Module exit_codes

Module exit_codes 

Source
Expand description

Standard Exit Code Catalog

Provides exit code lookups with standard names, descriptions, and categories.

§Example

use rsfulmen::foundry::exit_codes::{lookup_exit_code, ExitCategory, EXIT_SUCCESS, EXIT_FAILURE};

assert_eq!(EXIT_SUCCESS, 0);
assert_eq!(EXIT_FAILURE, 1);

let not_found = lookup_exit_code(404);
assert!(not_found.is_none()); // HTTP status != exit code

let ok = lookup_exit_code(0).unwrap();
assert_eq!(ok.name, "EXIT_SUCCESS");

Structs§

ExitCode
Exit code entry.

Enums§

ExitCategory
Exit code category identifier.

Constants§

EXIT_AUTHENTICATION_FAILED
Authentication failed (70)
EXIT_CANNOT_EXECUTE
Command found but could not be executed (126)
EXIT_CONFIG_INVALID
Configuration file invalid (20)
EXIT_DATA_INVALID
Data validation failed (60)
EXIT_FAILURE
Generic failure (1)
EXIT_HEALTH_CHECK_FAILED
Health check failed (30)
EXIT_INVALID_ARGUMENT
Invalid command-line argument (40)
EXIT_NOT_FOUND
Command not found (127)
EXIT_PERMISSION_DENIED
Permission denied (50)
EXIT_PORT_IN_USE
Port is already in use (10)
EXIT_SIGNAL_INT
SIGINT received (130)
EXIT_SIGNAL_KILL
SIGKILL received (137)
EXIT_SIGNAL_TERM
SIGTERM received (143)
EXIT_SUCCESS
Successful execution (0)
EXIT_TIMEOUT
Command timed out before completion (124)
EXIT_TIMEOUT_INTERNAL
Timeout utility itself failed (125)
EXIT_USAGE
Command usage error - BSD sysexits.h compatible (64)

Functions§

get_exit_name
Get the symbolic name for an exit code.
get_signal_from_exit
Get the signal number from a signal-induced exit code.
is_signal_exit
Check if an exit code was caused by a signal (128+).
is_success
Check if an exit code indicates success (code 0).
list_by_category
List all exit codes in a specific category.
list_exit_codes
List all exit codes in the catalog.
lookup_exit_code
Look up an exit code by its numeric value.