Skip to main content

Module error

Module error 

Source
Expand description

Structured error codes and JSON error formatting for agent-first UX.

Error code taxonomy (dot-separated):

  • input.missing_arg, input.invalid_value
  • auth.expired, auth.scope_denied, auth.missing_key
  • provider.timeout, provider.upstream_error, provider.not_found
  • tool.not_found, tool.execution_failed

Functions§

classify_error
Classify an error into a dot-separated error code by inspecting its message.
exit_code_for_error
Map an error code to a process exit code.
format_structured_error
Format a structured JSON error string for –output json mode.