Documentation Index
Fetch the complete documentation index at: https://mintlify.com/facunemi/evidence-sanitizer/llms.txt
Use this file to discover all available pages before exploring further.
evidence-sanitizer returns a specific exit code for every outcome so that shell scripts and CI pipelines can detect and handle failure conditions precisely. Exit code 0 means the command completed successfully — either a sanitized output file was written, or a dry run finished without errors. All non-zero codes indicate a specific category of failure, and the CLI always prints a human-readable error message to stderr alongside the non-zero exit.
Exit Code Reference
| Code | Name | Meaning |
|---|---|---|
0 | success | Sanitization completed and output was written, or --dry-run completed without errors. |
1 | EXIT_INTERNAL_ERROR | An unexpected internal error occurred. This is not expected during normal use. |
3 | EXIT_UNSAFE_PATH | An output path safety violation was detected: the output file already exists, the output path resolves to the same file as the input, or the output parent directory does not exist. |
4 | EXIT_INPUT_ERROR | The input file could not be read, is not a regular file, is not valid UTF-8 (or UTF-8 with BOM), exceeds the 10 MiB size limit, or contains NUL bytes. |
5 | EXIT_OUTPUT_ERROR | The output file could not be written after exclusive creation was attempted. |
Exit codes are intended for scripting and automation. Whenever the command exits with a non-zero code, it always prints a human-readable description of the failure to stderr before exiting. You do not need to parse exit codes to understand what went wrong interactively — but you do need them to branch on specific failure types in scripts.
Example Error Messages
Each non-zero exit code is accompanied by a stderr message in the formError: <description>.
Exit code 1 — internal error:
Using Exit Codes in Scripts
The following shell script runs sanitization and branches on the exit code to handle each failure category distinctly:CI Pipeline Example
In a CI environment you can use--dry-run combined with exit code checking to gate a pipeline on the presence of expected rule triggers, without writing any output file: