Search documentation of Localize

# Localize.FormatError exception (Localize v0.39.0)

Copy Markdown View Source

Exception raised when a value cannot be formatted by the requested message format function due to an incompatible type or missing configuration.

The `:reason` field is a documented atom describing the failure category. The `:detail` field carries any additional human-readable context produced by a downstream formatter (for example, the `Exception.message/1` text of the formatter's own error). The `:cause` field carries the underlying exception when one is available, so callers can pattern-match on the inner type.

## Summary

### Types

reason()
t()

## Types

# reason()

    @type reason() ::
      :unbalanced_markup
      | :mismatched_close
      | :formatter_failed
      | :downstream_failure

# t()

    @type t() :: %Localize.FormatError{
      __exception__: term(),
      cause: Exception.t() | nil,
      detail: String.t() | nil,
      function: atom() | nil,
      reason: reason() | nil,
      value: term() | nil
    }