Skip to content

feat: Add distinct exit codes for different error types #354

Description

@joshrotenberg

Summary

Add more granular exit codes to help with scripting, pipelines, and CI/CD workflows.

Current Behavior

  • 0: Success
  • 1: Any error

Proposed Exit Codes

Code Meaning
0 Success
1 Runtime error (file not found, I/O error, etc.)
2 Expression syntax error (invalid JMESPath)
3 Input parse error (invalid JSON)

Use Cases

  • CI pipelines can distinguish "bad query" from "bad input data"
  • Shell scripts can handle specific failure modes differently
  • Easier debugging when something fails

Notes

  • Keep it minimal - 3-4 codes max
  • Document in CLI reference
  • The "null result" case is intentionally NOT an error (use expressions to check for expected values if needed)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions