Exit codes
Each allyhub command exits 0 when it succeeds and with one of six codes when it fails, so a script or an agent can tell the kinds of failure apart.
The codes
Section titled “The codes”| Code | Meaning |
|---|---|
0 |
It succeeded. |
1 |
It ran and failed, or found problems: allyhub check exits 1 when a problem must be fixed. |
2 |
It was asked wrongly: an unknown option or an invalid value. |
3 |
A conflict: a file changed under it, or the place it would write is taken. |
4 |
It needs a sign-in, or the account may not do it: allyhub auth login. allyhub auth status exits 4 when the computer is not signed in. |
5 |
This computer lacks something: a tool, a runtime or a permission. allyhub doctor lists what it has. |
6 |
Not found: the item, file or tool asked for does not exist. |
130 |
Stopped by the person (Ctrl-C). |
The error with –json
Section titled “The error with –json”With --json, a command that fails prints its error on stdout as JSON, beside its exit code:
{ "error": { "code": "usage", "message": "What happened, for a person or an agent.", "hint": "What to do about it." }}| Field | What it is |
|---|---|
error.code |
Stable, in kebab case: what a program branches on. |
error.message |
What happened. |
error.hint |
What to do about it, when there is something to do. |