Cite.Error (Cite v0.2.0)

Copy Markdown View Source

A failed request: the concern it was judging (nil for a screening window), the passages it covered, and the reason. A failed request is never a verdict. It lands in Cite.Report.errors and nowhere else.

reason is whatever the provider returned, or:

  • {:missing_answers, keys} when a reply skipped a question.
  • {:malformed_answers, keys} when a reply answered one with a value its question cannot have.

Encoding with Jason always succeeds. Atoms, numbers, and UTF-8 strings pass through, and lists and plain maps are encoded value by value. Any other value, such as a tuple or a struct, becomes its inspect string, wherever it sits in the reason.

Summary

Types

t()

@type t() :: %Cite.Error{
  concern: atom() | nil,
  passage_ids: [String.t()],
  reason: term()
}