# `AshVault.Errors.PurposeUnsupported`
[🔗](https://github.com/jakeschurch/ash_vault/blob/main/lib/ash_vault/errors.ex#L467)

Raised when the key provider cannot serve keys for a purpose — typically a vault asked
to `mac!` over a provider whose `c:AshVault.KeyProvider.purposes/0` does not list
`:mac`, or a third-party provider written before purposes existed.

A configuration fault: retrying cannot help, and it is never reported as
`AshVault.Errors.ProviderUnavailable`. `use AshVault.Vault` catches it at compile time
whenever a `mac:` is configured explicitly and the provider module is already
compiled; this is the runtime backstop.

# `exception`

```elixir
@spec exception(opts :: Keyword.t()) :: %AshVault.Errors.PurposeUnsupported{
  __exception__: true,
  bread_crumbs: term(),
  class: term(),
  path: term(),
  provider: term(),
  purpose: term(),
  splode: term(),
  stacktrace: term(),
  vars: term()
}
```

Create an `Elixir.AshVault.Errors.PurposeUnsupported` without raising it.

## Keys

- :provider
- :purpose

---

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