Assent.JWTAdapter.AssentJWT.Error exception (Assent v0.4.0)

Copy Markdown View Source

An exception for JWT errors.

The :reason and :data fields are omitted from Inspect output as they may contain sensitive data.

Fields

  • :action - the operation that failed
  • :part - the JWT part associated with the failure, if any
  • :reason - the underlying failure reason
  • :data - the data associated with the failure

Examples

iex> error = Assent.JWTAdapter.AssentJWT.Error.exception(action: :decode, part: nil, reason: :invalid_format, data: ["header", "payload"])
iex> Exception.message(error)
"expected JWT to have three parts, got: 2"
iex> inspect(error)
"#Assent.JWTAdapter.AssentJWT.Error<action: :decode, part: nil, ...>"

Summary

Functions

Callback implementation for Exception.message/1.

Types

action()

@type action() :: :decode | :encode | :sign | :verify

part()

@type part() :: :header | :payload | :signature | nil

t()

@type t() :: %Assent.JWTAdapter.AssentJWT.Error{
  __exception__: term(),
  action: action(),
  data: term(),
  part: part(),
  reason: term()
}

Functions

message(map)

Callback implementation for Exception.message/1.