# `Assent.JWTAdapter.AssentJWT.Error`
[🔗](https://github.com/pow-auth/assent/blob/v0.4.0/lib/assent/jwt_adapter/assent_jwt.ex#L15)

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, ...>"

# `action`

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

# `part`

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

# `t`

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

# `message`

---

*Consult [api-reference.md](api-reference.md) for complete listing*
