Exspotify.Error (Exspotify v0.1.0)
View SourceError types and utilities for the Exspotify library.
Provides structured error handling with specific error types and helpful context.
Summary
Functions
Creates a configuration error with helpful suggestions.
Converts HTTP status codes and responses to structured errors.
Creates a JSON decode error.
Creates a network error.
Creates a new error struct with the given type and message.
Validates that an ID is present and non-empty.
Validates that a list is present and non-empty.
Validates that a token is present and non-empty.
Types
@type error_reason() ::
:invalid_id
| :empty_id
| :invalid_token
| :empty_token
| :invalid_type
| :empty_list
| :configuration_error
| :unauthorized
| :forbidden
| :not_found
| :rate_limited
| :server_error
| :bad_request
| :service_unavailable
| :network_error
| :timeout
| :json_decode_error
| :unexpected_response
@type t() :: %Exspotify.Error{ details: map() | nil, message: String.t(), status: integer() | nil, suggestion: String.t() | nil, type: error_reason() }
Functions
Creates a configuration error with helpful suggestions.
Converts HTTP status codes and responses to structured errors.
Creates a JSON decode error.
Creates a network error.
Creates a new error struct with the given type and message.
Validates that an ID is present and non-empty.
Validates that a list is present and non-empty.
Validates that a token is present and non-empty.