Exit code
An exit code is a numeric status returned by a process when it terminates to indicate the outcome of its execution.
Tiny Python Projects: Learn coding and testing with puzzles and games
An error code is a numeric process exit status indicating that a program terminated because an error occurred.
- How it is used
- Coordinates command-line error reporting, validation, testing, shell redirection, and pipeline control.
- How deep it goes
- Explains zero versus nonzero statuses, sys.exit() forms, STDERR routing, validation branches, and status assertions, but not operating-system status internals.
- Examples
- Demonstrates invalid arguments, missing placeholders, STDERR redirection, explicit sys.exit(1), string-based sys.exit(), and nonzero-status tests.
- What you can do after
- Apply it via Python's sys.exit() and argparse to report failures, separate diagnostics, stop pipelines, and test error behavior.
Read how Tiny Python Projects: Learn coding and testing with puzzles and games explains exit code →
Kubernetes in Action, Second Edition
An exit code is a numeric result returned by a process when it terminates, conventionally indicating success or failure.
- How it is used
- Uses process results to evaluate container health and interpret container termination during Kubernetes lifecycle operations.
- How deep it goes
- Explains zero, non-zero, 128+n, 137, and 143 codes, then applies them to probes, restarts, signals, and logs.
- Examples
- Demonstrates exit code 0 after graceful termination, code 137 after killing, and command results from an exec liveness probe.
- What you can do after
- Diagnose/debug with it by inspecting pod status, interpreting termination codes, and retrieving logs from the previous container.
Read how Kubernetes in Action, Second Edition explains exit code →
Related concepts
- sys.exitproduced by · sys.exit is a Python function that terminates program execution by raising a SystemExit exception with an optional exit status or message.
- testproduced by · A test is a procedure or check that evaluates behavior using specified inputs or evidence against expected results or criteria.
- parser.error()produced by · parser.error() is an argparse parser method that reports a command-line parsing error, displays usage information, and terminates the program with a failure status.
- statusproduces · A status is a field, section, value, or indicator that records the current condition, state, or outcome of a resource, entity, or operation.
- workflowmeasures · A workflow is an organized sequence of coordinated activities, tasks, or decisions through which work progresses toward an outcome.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

