Error codes
WRONG_ENVIRONMENT
This command does not run in the current environment.
Exit code: 2 · Who acts: You: correct the request or the environment · From: the CLI, the SDK and the backend
What it means
This command does not run in the current environment.
Common causes
- A
devcommand runs only on a local devnet. - A test command, such as test money, does not run in production.
Fix it
- Check where you are with
capxul whoami. - Change it with
capxul use env devnet, or--env.
In JSON and the SDK
With --json, the CLI prints:
{
"outcome": "refused",
"error": {
"code": "WRONG_ENVIRONMENT",
"message": "…"
}
}In the SDK, a failed result has result.error.code === "WRONG_ENVIRONMENT". Branch on the code, not on the message: the message is written for people and can change.
Commands that can answer with it
capxul dev keycapxul dev fundcapxul dev timecapxul dev time warpcapxul dev time start-atcapxul dev jobs runcapxul dev snapshot savecapxul dev snapshot listcapxul dev snapshot restorecapxul dev mail listcapxul dev mail noticescapxul dev mail failcapxul dev approvecapxul dev gates setcapxul dev prices set