Every structured error an agent can receive, and what it should do next.
8 sections5 min read
Codes are stable across releases. Match on error.code, never on error.message, and surface remedy to the user: it names the fix.
The shapejson
{"schemaVersion":1,"ok":false,"command":"reproduced","error":{"code":"branch_not_scanned","message":"release/2.4 has not been scanned yet.","remedy":"Run cf scan --repo acme/api --branch release/2.4.","exitCode":2}}
Access and usage
Code
Exit
What to do
auth_required
3
Not signed in. Ask the user to run cf auth login, then poll cf auth status --agent.
usage_error
2
Read remedy. It names the flag or argument that was missing or wrong.
feature_required
4
The account does not include this. Tell the user, and do not retry.
organization_required
2
The account belongs to several teams and the command named none. Run cf org list --agent, then pass --org <slug> or set CEFENSE_ORG.
organization_not_found
2
That slug is not a team the account belongs to. Run cf org list --agent for the real ones. A slug that does not exist gets the same answer, so read it as neither.
organization_forbidden
4
Your role does not allow that action. Report it and stop. Only the user can be given a different role.
unknown_organization
2
cf org use was given a slug the account does not have. Nothing was stored.
cancelled
130
Interrupted. Nothing was completed.
The plan refusing
Code
Exit
What to do
allowance_exhausted
4
The period's allowance is spent, so no scan will start. Run cf plan --agent for what is left and when it resets.
repository_limit
4
The plan covers fewer repositories. Tell the user to disconnect one or move up a plan.
depth_unavailable
4
Max depth is not on this plan. Re-run at default depth.
billing_forbidden
4
Only an owner or admin may change what the organization pays. canAdministerBilling says so in advance.
no_subscription
4
Nothing has ever been bought, so there is no billing portal. cf plan upgrade <plan> --agent prints a checkout URL for the user.
plan_unavailable
4
That plan or seat is not on sale on this deployment. Report it verbatim.
billing_unavailable
4
This deployment has no billing configured at all. No flag turns it on.
invalid_plan
2
Use plus, pro, or max. free is what an organization falls back to, not something to buy.
invalid_seats
2
A whole number from 0 to 500, counting seats beyond the ones the plan includes.