Assent.Strategy.CastError exception (Assent v0.4.0)

Copy Markdown View Source

An exception for when claims cannot be cast to the requested types.

The :claims field is omitted from Inspect output as it may contain sensitive data.

Fields

  • :claims - the original claims
  • :invalid_types - the expected types for the claims that couldn't be cast

Examples

iex> {:error, error} = Assent.Strategy.cast_claims(%{"email_verified" => "sometimes"}, %{"email_verified" => :boolean})
iex> error.invalid_types
%{"email_verified" => :boolean}

Summary

Functions

Callback implementation for Exception.message/1.

Types

t()

@type t() :: %Assent.Strategy.CastError{
  __exception__: term(),
  claims: map(),
  invalid_types: map()
}

Functions

message(exception)

Callback implementation for Exception.message/1.