AirtelMoney.Error exception (airtel_money v0.1.0)

Copy Markdown View Source

Error struct for Airtel Money SDK errors.

All API errors are returned as AirtelMoney.Error structs with a code, message, and HTTP status.

Summary

Functions

Creates an error from a message.

Creates an error from an HTTP response.

Creates a new error struct.

Types

t()

@type t() :: %AirtelMoney.Error{
  __exception__: true,
  code: String.t() | nil,
  message: String.t(),
  status: integer() | nil
}

Functions

from_message(message)

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

Creates an error from a message.

from_response(body, status)

@spec from_response(map(), integer()) :: t()

Creates an error from an HTTP response.

new(opts)

@spec new(keyword()) :: t()

Creates a new error struct.