-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Made *TimeError exceptions subtypes of TimeError. #4
Conversation
Also moved the definitions before their first usage.
Should I make PRs for minor stuff like this? I don't mind having a second set of eyes on this but for minor changes like this I'm comfortable pushing this directly to master if you're ok with it. |
dt::DateTime | ||
tz::TimeZone | ||
end | ||
Base.showerror(io::IO, e::AmbiguousTimeError) = print(io, "Local DateTime $(e.dt) is ambiguious"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is e.dt
going to show the local datetime because this is thrown when trying to construct a ZonedDateTime
? (just making sure there aren't other places where we'd through this where dt
is UTC)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The DateTime
s in these exceptions is just expected to be in localtime. We may want to extend the exceptions to be aware of what kind of DateTime
s they contain (local/UTC). Most of the time you only get into trouble using local DateTime
s which is why that is what is expected. There are some odd interactions within type.jl
such as:
throw(NonExistentTimeError(localtime(zdt), tz))
Definitely ok with you pushing stuff like this. |
Sounds good. Anything controversial I'll make sure to generate a PR for. |
Made *TimeError exceptions subtypes of TimeError.
Also moved the definitions before their first usage.