xema v0.9.3 Xema.CastError exception View Source

Raised when a cast fails.

Link to this section Summary

Functions

Formats the error map to an error message.

Link to this section Types

Link to this type

error() View Source
error() :: %{
  message: String.t() | nil,
  to: atom() | nil,
  value: term() | nil,
  key: String.t() | atom() | nil,
  path: [atom() | integer() | String.t()] | nil,
  error: struct() | nil
}

Link to this type

t() View Source
t() :: %Xema.CastError{
  __exception__: term(),
  error: term(),
  key: term(),
  message: term(),
  path: term(),
  to: term(),
  value: term()
}

Link to this section Functions

Link to this function

format_error(error) View Source
format_error(Exception.t() | error()) :: String.t()

Formats the error map to an error message.