Sinter.ValidationError exception (Sinter v0.0.1)
View SourceException 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.
Summary
Functions
Gets the validation errors from the exception.
Creates a new ValidationError from a list of errors.
Formats the validation error for display.
Types
@type t() :: %Sinter.ValidationError{ __exception__: true, errors: [Sinter.Error.t()], message: String.t() }
Functions
@spec errors(t()) :: [Sinter.Error.t()]
Gets the validation errors from the exception.
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
Formats the validation error for display.