Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions src/cli/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,8 @@ export async function main(rawArgv: string[]): Promise<number> {
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;
}
}
Expand Down
16 changes: 0 additions & 16 deletions src/core/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
}
Loading