Zot.Issue exception (zot v0.12.0)

View Source

Represents a single issue found when parsing / validating a value against a type.

Summary

Types

Represents a segment in a path.

t()

Zot's issue struct.

Functions

Creates a new issue.

Prepends segements to the given issue's path.

Renders the given list of issues into a pretty-printed string.

Summarizes a list of issues into a map of field path (dot-notated) to its messages.

Types

segment()

@type segment() :: String.t() | atom() | non_neg_integer()

Represents a segment in a path.

t()

@type t() :: %Zot.Issue{
  __exception__: true,
  params: keyword(),
  path: [segment()],
  template: String.t()
}

Zot's issue struct.

Functions

issue(template)

@spec issue(template :: String.t()) :: t()

Creates a new issue.

issue(template, params)

@spec issue(template, params) :: t() when template: String.t(), params: keyword()
@spec issue(path, template) :: t() when path: [segment()], template: String.t()

issue(path, template, params)

@spec issue(path :: [segment()], template :: String.t(), params :: keyword()) :: t()

prepend_path(issue, segments)

@spec prepend_path(t(), [segment()]) :: t()
@spec prepend_path([t(), ...], [segment()]) :: [t(), ...]

Prepends segements to the given issue's path.

pretty_print(issues, opts \\ [])

Renders the given list of issues into a pretty-printed string.

summarize(issues)

@spec summarize([t(), ...]) :: %{optional(String.t()) => [String.t(), ...]}

Summarizes a list of issues into a map of field path (dot-notated) to its messages.