# `Sinter.ValidationError`
[🔗](https://github.com/nshkrdotcom/sinter/blob/v0.3.1/lib/sinter/error.ex#L352)

Exception raised by `validate!` functions when validation fails.

This exception contains the validation errors that caused the failure,
allowing the caller to access detailed error information programmatically.

# `t`

```elixir
@type t() :: %Sinter.ValidationError{
  __exception__: true,
  errors: [Sinter.Error.t()],
  message: String.t()
}
```

# `errors`

```elixir
@spec errors(t()) :: [Sinter.Error.t()]
```

Gets the validation errors from the exception.

# `exception`

```elixir
@spec exception(keyword()) :: t()
```

Creates a new ValidationError from a list of errors.

## Examples

    iex> errors = [Sinter.Error.new([:name], :required, "field is required")]
    iex> raise Sinter.ValidationError, errors: errors

# `format`

```elixir
@spec format(t()) :: String.t()
```

Formats the validation error for display.

---

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