ntro CLI
Exit codes
Tell why ntro failed in a script from its exit code.
ntro returns a number (its exit code) when it finishes. Check it with $? in CI or scripts to handle each kind of failure differently.
| Code | Meaning | What to check |
|---|---|---|
0 | Success | — |
1 | Any other error (build failure, deployment failure, wait timeout, ...) | The build log: ntro builds logs |
2 | Wrong usage, argument, or option | ntro <command> --help |
3 | The API returned 401 or 403 | Whether your login or token is valid and you have access to that team |
4 | The API returned 400 or 422 | Whether the values you sent are correct |
5 | The API returned 409 | Whether the request conflicts with the current state (for example, deleting a team that still has apps) |
6 | Network error | Your internet connection and proxy settings |
Reading error messages
- Errors are printed as text on stderr even with
--json, so you only need to parse the JSON on stdout. - Errors returned by the server use the form
<code>: <message>where possible. - Usage errors include brief usage and a
--helphint; some API errors suggest the next command to run. - When you send too many requests and get
429, and the server says how long to wait, the message includes that delay in seconds.
Authentication errors
- API token expired: create a new token in the console.
- Login expired: log in again with
ntro login.