Artefact.Error.Invalid exception (Artefact v0.2.0)

Copy Markdown View Source

Validation rule violations on an %Artefact{}.

Returned as {:error, %Artefact.Error.Invalid{reasons: [...]}} from Artefact.validate/1 and from any operation that received an invalid input or produced an invalid output. Raised by Artefact.validate!/1 and by the ! variants of the operations.

:reasons is a list of human-readable strings, one per rule violation.

Summary

Functions

exception(args)

@spec exception(opts :: Keyword.t()) :: %Artefact.Error.Invalid{
  __exception__: true,
  bread_crumbs: term(),
  class: term(),
  path: term(),
  reasons: term(),
  splode: term(),
  stacktrace: term(),
  vars: term()
}

Create an Elixir.Artefact.Error.Invalid without raising it.

Keys

  • :reasons