# `Localize.InvalidValueError`
[🔗](https://github.com/elixir-localize/localize/blob/v0.39.0/lib/localize/exception/invalid_value_error.ex#L1)

Exception raised when a value does not meet the expected type
or constraints for an operation.

`:expected` is either an atom naming the expected category
(for example `:rounding_mode`, `:time_unit`, `:usage`) or a
short string label describing the expected shape. `:allowed_values`,
when set, carries the closed list of acceptable values that the
rendered message will include.

# `t`

```elixir
@type t() :: %Localize.InvalidValueError{
  __exception__: term(),
  allowed_values: [term()] | nil,
  context: term() | nil,
  expected: atom() | String.t() | nil,
  value: term()
}
```

---

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