AzureSDK.Error (Azure SDK v0.1.0)

Copy Markdown View Source

Standardized, pattern-match friendly error struct for all AzureSDK operations.

All public APIs return {:ok, result} or {:error, %AzureSDK.Error{}}.

Summary

Functions

Builds an error from a transport-level exception or reason.

Builds an error from an HTTP response body and headers.

Creates a new error struct.

Types

t()

@type t() :: %AzureSDK.Error{
  cause: term() | nil,
  code: String.t() | nil,
  details: map() | nil,
  message: String.t() | nil,
  request_id: String.t() | nil,
  service: atom() | nil,
  status: non_neg_integer() | nil
}

Functions

from_exception(service, reason)

@spec from_exception(atom(), term()) :: t()

Builds an error from a transport-level exception or reason.

from_response(service, status, headers, body)

@spec from_response(atom(), non_neg_integer(), map(), binary() | nil) :: t()

Builds an error from an HTTP response body and headers.

new(fields)

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

Creates a new error struct.