Skip to content

Exit codes

Exit codes are a first-class contract: distinct, documented, and append-only. Scripts and agents can rely on them without parsing human-readable text.

Code table

CodeNameNotes
0okSuccess.
1generic_errorUnclassified error (internal or unrecognised upstream response).
2usageBad arguments or parse error — check the command syntax.
3empty_resultsRequest succeeded but matched nothing.
4auth_requiredReserved, never emitted. vabc requires no authentication.
5not_foundUnknown product code, store number, or geocode input.
6permissionReserved, never emitted.
7rate_limitedThrottled or blocked by the upstream or the local circuit-breaker.
8retryableTransient upstream or network error — retry shortly.
10config_errorLocal configuration problem (e.g. bad env var value).
12mutation_blockedReserved, never emitted. vabc is read-only; no mutations exist.
13input_required--no-input is set but interactive input is required.
130cancelledInterrupted by SIGINT.

Codes 9, 11, and 14 are intentionally unassigned.

Error envelope

Every error that vabc can classify is emitted to stderr only. Data always goes to stdout.

Plain format (default)

Terminal window
error: product 999999 not found
code: NOT_FOUND
fix: list available products to find a valid id

JSON format (--json or --format json)

{
"error": "product 999999 not found",
"code": "NOT_FOUND",
"remediation": "list available products to find a valid id"
}

The three fields are always present (remediation may be an empty string). JSON output has HTML escaping disabled and uses two-space indentation.

How codes are triggered

7 rate_limited

Emitted when the local throttle or circuit-breaker fires before a live call is made, and also when the upstream itself returns a 429 or equivalent block. The error message includes a retry-after hint when the upstream provides one.

By default vabc fails fast (exit 7) so agent loops never deadlock. Pass --wait to wait out the backoff instead; --max-wait sets the ceiling (default 30s).

Terminal window
vabc inventory check 010807 --near 22182 --wait --max-wait 60s

8 retryable

A transient upstream or network error that is not classified as rate limiting. Retry the same command; if errors persist, run vabc doctor --online to check connectivity.

5 not_found

Returned for an unrecognised product code after a Coveo product lookup, an invalid store number, or a geocode failure. Example:

Terminal window
vabc product get 000000 # exit 5 — no product with that code
vabc store get 9999 # exit 5 — no store with that number

13 input_required

Pass --no-input in scripts or agent contexts to guarantee vabc never blocks on a prompt. Any path that would otherwise prompt the user exits 13 instead.

Terminal window
vabc inventory check 010807 --no-input # exits 13 if location prompt is needed

130 cancelled

Standard POSIX convention: 128 + signal 2 (SIGINT). Emitted when the user presses Ctrl-C or the process receives SIGINT.

Machine-readable table

The live code table is also embedded in vabc schema --json under exit_codes. It is generated from the same errs package the runtime uses, so it cannot drift from actual behaviour.

Terminal window
vabc schema --json | jq '.exit_codes'

See Commands for full schema output, and Flags and environment variables for --wait, --max-wait, and --no-input.