diff --git a/src/cli/index.ts b/src/cli/index.ts index d574602..e8e2bdc 100644 --- a/src/cli/index.ts +++ b/src/cli/index.ts @@ -94,10 +94,8 @@ export async function main(rawArgv: string[]): Promise { return await cmd.run(argv, ctx); } catch (err) { printError(err, json); - // Any error exits 1. We do not overload the exit code to signal error kind: - // the capability-gated commands catch internally and return 1 already, so a - // CAPABILITY_UNAVAILABLE→2 mapping here never fired. Machine consumers read - // the precise `error.code` from --json output instead. + // Any error exits 1 — the exit code doesn't encode error kind. Machine + // consumers read the precise `error.code` from the --json output instead. return 1; } } diff --git a/src/core/errors.ts b/src/core/errors.ts index 23d57af..bbecb7a 100644 --- a/src/core/errors.ts +++ b/src/core/errors.ts @@ -98,19 +98,3 @@ export function quotaExhausted( suggested_commands: claimUrl ? [] : ["zenrows usage"], }); } - -/** Build the canonical "this capability is not configured" error. */ -export function capabilityUnavailable( - capabilityLabel: string, - command: string, - suggested: string[], -): ToolkitError { - return new ToolkitError({ - code: "CAPABILITY_UNAVAILABLE", - message: `${capabilityLabel} is not configured for this backend yet.`, - likely_cause: `The cloud primitive behind \`${command}\` is not enabled for this account or has not shipped.`, - next_action: - "Use a local spec / validation path, or escalate to a confirmed primitive (Protected Fetch / Extract).", - suggested_commands: suggested, - }); -}