Twilio.Error (twilio_elixir v0.1.1)

Copy Markdown View Source

Twilio API error.

Represents both API errors (4xx/5xx responses with Twilio error bodies) and connection-level errors (network failures, timeouts).

Summary

Functions

Build a connection error.

Build error from HTTP response status, body, and headers.

Is this error retryable?

Types

error_type()

@type error_type() ::
  :api_error
  | :authentication_error
  | :rate_limit_error
  | :not_found_error
  | :invalid_request_error
  | :connection_error

t()

@type t() :: %Twilio.Error{
  code: integer() | nil,
  details: map() | nil,
  http_body: String.t() | nil,
  http_status: integer() | nil,
  message: String.t() | nil,
  more_info: String.t() | nil,
  request_id: String.t() | nil,
  retry_after: integer() | nil,
  type: error_type()
}

Functions

connection_error(message)

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

Build a connection error.

from_response(status, body, headers)

@spec from_response(integer(), String.t(), list()) :: t()

Build error from HTTP response status, body, and headers.

retryable?(arg1)

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

Is this error retryable?