Codex.TransportError exception (Codex SDK v0.7.2)

Copy Markdown View Source

Raised when the codex executable exits unexpectedly.

The retryable? field indicates whether the error is transient and the operation can be safely retried. This is used by Codex.Retry to determine whether to attempt automatic retries.

Summary

Functions

Creates a new TransportError.

Determines if an exit status indicates a retryable error.

Types

t()

@type t() :: %Codex.TransportError{
  __exception__: true,
  exit_status: integer(),
  message: String.t(),
  retryable?: boolean(),
  stderr: String.t() | nil
}

Functions

new(status, opts \\ [])

@spec new(
  integer(),
  keyword()
) :: t()

Creates a new TransportError.

Options

  • :stderr - Standard error output from the process
  • :message - Custom error message
  • :retryable? - Whether the error is retryable (default: inferred from exit status)

retryable_status?(status)

@spec retryable_status?(integer()) :: boolean()

Determines if an exit status indicates a retryable error.

Retryable statuses include:

  • Signal-based exits (128+) for SIGTERM, SIGKILL, SIGPIPE
  • Exit code 75 (EX_TEMPFAIL)
  • Exit code 69 (EX_UNAVAILABLE)