View Source Elixact.Error (elixact v0.1.1)
Structured error representation for Elixact validation errors.
Summary
Types
Functions
Formats an error into a human-readable string.
Example
iex> Error.format(%Error{path: [:user, :email], code: :format, message: "invalid format"})
"user.email: invalid format"
Creates a new validation error.
Parameters
path
- Path to the field that caused the errorcode
- Error code identifying the type of errormessage
- Human-readable error message
Example
iex> Error.new([:user, :email], :format, "invalid email format")
%Error{path: [:user, :email], code: :format, message: "invalid email format"}