Calendrical. DateRangeParseError exception
(Calendrical v0.9.0)
Copy Markdown
Returned (or raised) by Calendrical.Date.parse_range/2 when an
input cannot be interpreted as a date range, or when both
endpoints parsed successfully but the resulting range is invalid.
Carries semantic fields only; the human-readable description is
materialised by message/1. Pattern-match on :reason to branch
on failure category without parsing prose.
Fields
:input— the raw input that was passed in. A binary for the single-string form, a{from, to}tuple for the pair form.:reason— atom describing the failure category. Seereason_atoms/0for the closed set of permitted values.:locale— the locale the parser tried. Set for failures surfaced before sub-parsing (e.g.:no_separator).:from,:to— the parsed endpoints. Set when the failure occurs after both endpoints parsed successfully (e.g.:inverted).:cause— the wrapped inner exception when this error is a wrapper for a sub-parser failure (:from_parse_failed/:to_parse_failed).nilotherwise.
Summary
Types
@type reason() :: :no_separator | :inverted | :from_parse_failed | :to_parse_failed