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

Raised when a searchable field's `normalize:` strategy did not produce a binary.

A lookup token is `HMAC-SHA256(key, normalized_plaintext)`, so the normalized value
has to be bytes. AshVault deliberately does not `to_string/1` whatever it was handed:
`inspect/1` of a struct is a stable-looking string that would silently become the
searchable identity of the row, and two structs differing only in a field `inspect`
truncates would collide.

The offending value is **described, never reproduced** — it is the plaintext of an
encrypted field, and this error travels wherever Ash sends errors.

# `exception`

```elixir
@spec exception(opts :: Keyword.t()) :: %AshVault.Errors.LookupNormalizationFailed{
  __exception__: true,
  bread_crumbs: term(),
  class: term(),
  field: term(),
  path: term(),
  resource: term(),
  splode: term(),
  stacktrace: term(),
  strategy: term(),
  value: term(),
  vars: term()
}
```

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

## Keys

- :resource
- :field
- :strategy
- :value

---

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