Exit codes
A script or scheduled job can use the exit code of the russet command to
check whether the command succeeded. This page lists the codes and the commands
that return them.
Exit codes
Section titled “Exit codes”The russet command returns the following codes:
| Code | Meaning | Returned by |
|---|---|---|
0 |
The command succeeded. | Every verb, and russet VERB --help. |
1 |
The command failed, and Russet printed the reason to standard error. | Most verbs. For run and install, this code means that validation failed and no recipe ran. audit returns it when a finding reaches the --fail-on severity, and verify-trust-info returns it when an override fails verification. russet help and russet with no verb also return it. |
2 |
Russet couldn’t parse an option. It printed the verb’s usage and the error. | Every verb that accepts options. |
70 |
At least one recipe failed while it ran. Other recipes in the same command might have succeeded. | run and install. |
255 |
The arguments were wrong for the verb, such as a missing recipe name. On Windows, the code is -1. |
run, install, audit, info, make-override, new-recipe, processor-info, repo-add, repo-delete, repo-update, update-trust-info, and verify-trust-info. |
Handle exit codes in scripts
Section titled “Handle exit codes in scripts”Treat any exit code other than 0 as a failure. The following codes need
different follow-up:
1fromrunorinstall: no recipe ran. Read standard error to find the recipe that failed validation, such as a missing recipe, a failed trust check on an override, or an unsupported processor.70fromrunorinstall: some recipes ran. Use--report-plistto save a report, and read itsfailuresarray to find the recipes that failed.255or-1: the command’s arguments are wrong. Check the command in your script.
Some commands return 0 even when part of the work failed:
repo-addandrepo-updatereturn0when Git fails.repo-deletereturns0when it can’t find a recipe repository.auditreturns0when it can’t find a recipe, unless a finding reaches the--fail-onseverity.
Check the output of these commands, or follow them with a command that
verifies the result, such as russet repo-list.