Skip to content

feat: document and stabilize exit codes and error.code values #634

Description

@margaretjgu

We almost always exit 1. JSON errors use ad hoc error.code strings (transport_error, confirmation_required, input_validation_failed, command_blocked) with no catalog.

For agents this is the difference between retry with --yes and give up.

  1. Publish a table (help topic in feat: add help topics for formatting, environment, and exit codes #630): 0 success, 1 generic, then reserve 2 usage, 3 validation, 4 auth/config, 5 network. Implementing the split can follow the table. Do not silently change codes on existing scripts without a changelog note.
  2. Freeze error.code strings in AGENTS.md. Add codes for auth_required, config_invalid, not_found if we do not already emit them.
  3. elastic status --json should be the probe agents run after auth_required / transport_error.

Acceptance: help topic lists codes. --json errors on a missing config use a documented code. One test per code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancement

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions