ts-time/errors
Available since ts-time 0.2.2.
Consumption
import * as errors from "ts-time/errors";
TemporalError#
Hierarchy#
Description#
Base error class. Message of this error is designed to be user-friendly, thus can be displayed to the end user.
Extends standard
Error .
Fields#
message#
readonly message: string
User-friendly user message.
TemporalParsingError#
Hierarchy#
Description#
Error thrown by various temporal parsing methods.
Fields#
str#
readonly str: string
Original string that was being parsed.
cls#
readonly cls: string
User-friendly temporal class name, such as "a local date", "local time" etc.
reason#
readonly reason: string
User-friendly error reason.
readonly message: string
User-friendly user message.
InvalidTemporalFormatError#
Hierarchy#
Description#
Provided string doesn't match ISO 8601 standard. One of possible reasons for
TemporalParsingError .
Fields#
expectedFormat#
readonly expectedFormat: string
User-friendly name of the expected ISO 8601 format.
readonly message: string
User-friendly user message.
InvalidTimeZoneError#
Hierarchy#
Description#
Provided string contains an invalid or unrecognized time zone ID or offset.
One of possible reasons for
TemporalParsingError .
Fields#
readonly id: string
Time zone ID attempted to be parsed.
readonly message: string
User-friendly user message.
MismatchingOffsetError#
Hierarchy#
Description#
Provided string contains an offset that doesn't match the specified time zone at a given date/time. For example,
"2019-07-05T18:30:15.225Z[Europe/Berlin]", because Europe/Berlin time zone has +01:00 offset in summer.
One of possible reasons for
TemporalParsingError .
Fields#
offset#
readonly offset: any
The specified time zone offset.
zonedDateTime#
readonly zonedDateTime: any
Mismatching date/time with a time zone.
readonly message: string
User-friendly user message.
InvalidDayOfWeekError#
Hierarchy#
Description#
Provided day of week number is NaN, fractional or out of 1-7 bounds.
Fields#
value#
readonly value: any
The provided invalid value.
readonly message: string
User-friendly user message.
InvalidMonthError#
Hierarchy#
Description#
Provided month number is NaN, fractional or out of 1-12 bounds. One of possible reasons for
TemporalParsingError .
Fields#
value#
readonly value: any
The provided invalid value.
readonly message: string
User-friendly user message.
© Copyright: Egor Nepomnyaschih