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.

CodeMeaningWhat to check
0Success—
1Any other error (build failure, deployment failure, wait timeout, ...)The build log: ntro builds logs
2Wrong usage, argument, or optionntro <command> --help
3The API returned 401 or 403Whether your login or token is valid and you have access to that team
4The API returned 400 or 422Whether the values you sent are correct
5The API returned 409Whether the request conflicts with the current state (for example, deleting a team that still has apps)
6Network errorYour 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 --help hint; 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.

On this page