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_ENVor a saved default.
Fix it
- Choose one for every later command:
capxul use env devnet. - 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.