Calendrical.ParseError exception (Calendrical v0.6.0)

Copy Markdown

Returned (or raised) by Calendrical.parse/2 when no sub-parser could interpret the input as a date, time, datetime, or date range.

Carries semantic fields only; the human-readable description is materialised by message/1. Inspect :attempts to see what each sub-parser reported.

Fields

  • :input — the raw string that failed to parse.

  • :locale — the locale the parser tried.

  • :attempts — keyword list of {kind, exception} recording each sub-parser that was tried and the exception it returned, in the order they were attempted. kind is one of :interval, :date, :time, :datetime.

Summary

Types

attempt()

@type attempt() :: {kind(), Exception.t()}

kind()

@type kind() :: :interval | :date | :time | :datetime

t()

@type t() :: %Calendrical.ParseError{
  __exception__: term(),
  attempts: [attempt()] | nil,
  input: String.t() | nil,
  locale: atom() | String.t() | nil
}