ApplePushNotifications.Error exception (apple_push_notifications v0.3.0)

Copy Markdown View Source

Structured exception for APNs API failures.

Summary

Functions

Create an error from an HTTP response.

Check if the error indicates an invalid device token.

Get the error reason code from an APNs error response.

Types

t()

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

Functions

from_http(status, body)

@spec from_http(integer(), map() | binary() | nil) :: t()

Create an error from an HTTP response.

invalid_token?(arg1)

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

Check if the error indicates an invalid device token.

reason_code(arg1)

@spec reason_code(t()) :: String.t() | nil

Get the error reason code from an APNs error response.