SaltDns.Zones.Error (Salt v1.0.0)

A validation error with the path of the offending field.

The path is a list of keys and list indexes, for example [:records, 1, :rdata], so that an API or form can point at the exact input that was refused.

Summary

Functions

Builds an error.

Puts prefix in front of the path of every error.

Types

t()

@type t() :: %SaltDns.Zones.Error{
  code: atom(),
  message: String.t(),
  path: [atom() | non_neg_integer()]
}

Functions

new(path, code, message)

@spec new([atom() | non_neg_integer()], atom(), String.t()) :: t()

Builds an error.

prefix(errors, prefix)

@spec prefix([t()], [atom() | non_neg_integer()]) :: [t()]

Puts prefix in front of the path of every error.