Assent.MissingParamError exception (Assent v0.4.0)

Copy Markdown View Source

An exception for when a required parameter is missing.

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

Fields

  • :key - the missing parameter name
  • :params - the original parameters
  • :source - whether the parameters came from regular params or a token

Examples

iex> {:error, error} = Assent.fetch_token_param(%{"access_token" => "secret"}, "refresh_token")
iex> Exception.message(error)
"expected \"refresh_token\" in token, got: [\"access_token\"]"
iex> inspect(error)
"#Assent.MissingParamError<key: \"refresh_token\", source: :token, ...>"

Summary

Functions

Callback implementation for Exception.message/1.

Types

t()

@type t() :: %Assent.MissingParamError{
  __exception__: term(),
  key: binary(),
  params: map(),
  source: :params | :token
}

Functions

message(exception)

Callback implementation for Exception.message/1.