Tinkex.Types.RequestErrorCategory (Tinkex v0.3.4)

View Source

Request error category.

Mirrors Python tinker.types.request_error_category.RequestErrorCategory. Wire format uses lowercase strings: "unknown" | "server" | "user" (Python StrEnum.auto() returns lowercase in Python 3.11+)

Parser is case-insensitive for defensive robustness.

Summary

Functions

Parse wire format string to atom (case-insensitive).

Check if error category is retryable.

Convert atom to wire format string.

Types

t()

@type t() :: :unknown | :server | :user

Functions

parse(value)

@spec parse(String.t() | nil) :: t()

Parse wire format string to atom (case-insensitive).

Defaults to :unknown for unrecognized values.

retryable?(atom)

@spec retryable?(t()) :: boolean()

Check if error category is retryable.

User errors are not retryable; server and unknown errors are.

to_string(atom)

@spec to_string(t()) :: String.t()

Convert atom to wire format string.