# Functions
GetAPIError extracts an APIError from an error if possible Returns nil if the error is not an APIError.
HTTPStatusForError returns an appropriate HTTP status code for the given error.
IsAPIError checks if an error is or wraps an APIError.
IsPermanent checks if the given error is or contains a PermanentError.
NewAPIError creates a new APIError with the given parameters.
NewAuthenticationError creates an authentication error with the given message.
NewInvalidField creates an invalid request error for a specific field.
NewInvalidRequest creates an invalid request error with the given message.
NewMissingField creates an error for a missing required field.
NewPermissionError creates a permission error with the given message.
NewRateLimitError creates a rate limit error with the given message.
NewServerError creates a server error with the given message.
Permanent wraps the given err in a *PermanentError.
PermanentIf wraps the error as permanent if the condition is true.
# Constants
No description provided by the author
Server errors.
Authentication errors.
No description provided by the author
No description provided by the author
Request-related errors.
No description provided by the author
No description provided by the author
Rate limit errors.
No description provided by the author
No description provided by the author
ErrorTypeAuthentication indicates issues with API keys or authentication.
ErrorTypeInvalidRequest indicates an error with the request format or parameters.
ErrorTypePermission indicates issues with permissions for the requested operation.
ErrorTypeRateLimit indicates the client has sent too many requests.
ErrorTypeServer indicates an internal server error.
# Structs
APIError represents a structured error from the API This is the primary error type that should be used for all API-related errors.
ErrorDetails represents the nested error details in an error response.
ErrorResponse represents the complete error response from the API.
PermanentError signals that the operation should not be retried.