Search documentation of Localize

# Localize.InvalidValueError exception (Localize v0.39.0)

Copy Markdown View Source

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.

## Summary

### Types

t()

## Types

# t()

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