Localize.DateParseError exception (Localize v1.4.0)

Copy Markdown View Source

Returned (or raised) by Localize.Date.parse/2 when an input string cannot be interpreted as a date.

Carries semantic fields only; the human-readable description is materialised by message/1 so callers can pattern-match on structure (input/locale/calendar) without parsing prose.

Fields

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

  • :locale — the locale the parser tried.

  • :calendar — the calendar module the input was parsed for.

  • :format — the format the input was to be read with, when the :format option named one, and otherwise nil.

Summary

Types

t()

@type t() :: %Localize.DateParseError{
  __exception__: term(),
  calendar: module() | nil,
  format: atom() | String.t() | struct() | nil,
  input: String.t() | nil,
  locale: atom() | String.t() | nil
}