Ash.Changeset.handle_errors
You're seeing just the function
handle_errors
, go back to Ash.Changeset module for more information.
Specs
handle_errors( t(), (t(), error :: term() -> :ignore | t() | (error :: term()) | {error :: term(), t()}) | {module(), atom(), [term()]} ) :: t()
Sets a custom error handler on the changeset.
The error handler should be a two argument function or an mfa, in which case the first two arguments will be set to the changeset and the error, w/ the supplied arguments following those.
Any errors generated are passed to handle_errors
, which can return any of the following:
:ignore
- the error is discarded, and the changeset is not marked as invalidchangeset
- a new (or the same) changeset. The error is not added (you'll want to add an error yourself), but the changeset is marked as invalid.{changeset, error}
- a new (or the same) error and changeset. The error is added to the changeset, and the changeset is marked as invalid.anything_else
- is treated as a new, transformed version of the error. The result is added as an error to the changeset, and the changeset is marked as invalid.