Error codes

ENVIRONMENT_NOT_CHOSEN

No environment is chosen, and this command needs one.

Exit code: 2 · Who acts: You: correct the request or the environment · From: the CLI only

What it means

No environment is chosen, and this command needs one.

Common causes

  • Nothing set --env, CAPXUL_ENV or a saved default.

Fix it

  1. Choose one for every later command: capxul use env devnet.
  2. Or choose one for one command: --env staging.

In JSON and the SDK

With --json, the CLI prints:

{
  "outcome": "refused",
  "error": {
    "code": "ENVIRONMENT_NOT_CHOSEN",
    "message": "…"
  }
}

Only the CLI answers with this code. The SDK never returns it. Branch on the code, not on the message: the message is written for people and can change.

Commands that can answer with it

Every command can answer with this code.

On this page