Polarex.Error exception (Polarex v0.8.2)

Copy Markdown View Source

A failed Polar API call.

Every operation returns {:error, %Polarex.Error{}} on failure:

  • status - the HTTP status, or nil for transport errors
  • message - a human-readable description
  • validation_errors - decoded Polarex.ValidationError structs on 422s
  • body - the raw decoded response body, if any
  • reason - the transport error reason, when the request never got a response

It is an exception, so it can also be raised directly.

Summary

Types

t()

@type t() :: %Polarex.Error{
  __exception__: true,
  body: term(),
  message: String.t(),
  reason: term(),
  status: integer() | nil,
  validation_errors: [Polarex.ValidationError.t()]
}