Tinkex.Error (Tinkex v0.3.4)
View SourceError type for Tinkex operations.
Mirrors Python tinker error handling with categorization for retry logic.
Summary
Functions
Format error as string.
Create an error from an HTTP response.
Create a new error.
Check if error is retryable.
Check if error is a user error (not retryable).
Types
@type error_type() ::
:api_connection | :api_timeout | :api_status | :request_failed | :validation
@type t() :: %Tinkex.Error{ category: Tinkex.Types.RequestErrorCategory.t() | nil, data: map() | nil, message: String.t(), retry_after_ms: non_neg_integer() | nil, status: integer() | nil, type: error_type() }
Functions
Format error as string.
Create an error from an HTTP response.
@spec new(error_type(), String.t(), keyword()) :: t()
Create a new error.
Check if error is retryable.
Check if error is a user error (not retryable).
Truth table:
- category == :user → YES
- status 4xx (except 408, 429) → YES
- Everything else → NO