pub enum TimeError {
ProjectionError(ProjectDateTimeError),
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§
ProjectionError(ProjectDateTimeError)
Created when trying to create a DateTime
, however the projection to a
UNIX timestamp wasn’t achievable. Generally thrown when exceeding the
range of integers (e.g. > i64::Max
).
Note: This is just a wrapper over tz::error::ProjectDateTimeError
.
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::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).