pub enum TimeError {
LocalTimeType(LocalTimeTypeError),
ComponentOutOfRangeError(DateTimeError),
UnknownTzError(TzError),
TzStringError(TzStringError),
TzOutOfRangeError(TzOutOfRangeError),
IntOverflowError(IntOverflowError),
Unknown,
}
Expand description
A wrapper around some of the errors provided by tz-rs
.
Variants§
LocalTimeType(LocalTimeTypeError)
Created when trying to create a DateTime
, however the local time zone
designation is malformed.
ComponentOutOfRangeError(DateTimeError)
Created when one of the parameters of a DateTime
falls outside the
allowed ranges (e.g. 13th month, 32 day, 24th hour, etc).
Note: tz::error::datetime::DateTimeError
is only thrown from tz-rs
when a provided component value is out of range.
Note: This is different from how MRI ruby is implemented. e.g. Second 60 is valid in MRI, and will just add an additional second instead of erroring.
UnknownTzError(TzError)
A rescuable error originally from the tz-rs
library.
TzStringError(TzStringError)
Indicates that there was an issue when parsing a string for an offset.
TzOutOfRangeError(TzOutOfRangeError)
The provided tz offset seconds offset is outside of the allowed range.
IntOverflowError(IntOverflowError)
A rescuable Integer overflow error. Caused when trying to exceed the bounds of an int.
Unknown
An rescuable unknown error (instead of panicking).