Skip to content

add rejected timestr in exception message providing more information to caller#300

Merged
pganssle merged 1 commit into
dateutil:masterfrom
pbiering:pbiering-improve-exception-message
Jul 16, 2017
Merged

add rejected timestr in exception message providing more information to caller#300
pganssle merged 1 commit into
dateutil:masterfrom
pbiering:pbiering-improve-exception-message

Conversation

@pbiering

@pbiering pbiering commented Oct 16, 2016

Copy link
Copy Markdown
Contributor

helpful if exeption is catched above for displaying instead of being blind, e.g. diagnosting broken vcalendar items:

vobject.base.ParseError: "In transformToNative, unhandled exception on line None: <class 'ValueError'>: ('Unknown string format:', '1970DTSTART:19700329T020000')"
vobject.base.ParseError: "In transformToNative, unhandled exception on line None: <class 'ValueError'>: ('Unknown string format:', '19701TZOFFSETFROM:-0000')"

(don't ask how such entries can occur...)

@pganssle pganssle self-assigned this Mar 28, 2017
@pganssle pganssle added this to the Feature release milestone Mar 28, 2017
@pganssle

Copy link
Copy Markdown
Member

This seems perfectly reasonable to me, but I have a few bugfixes I want to push in a bugfix release, and I'm afraid that this sort of thing should not be changed in a bugfix release, in the event that someone is (possibly improbably) relying on the current error message being the same.

Ideally, we'd also change this to a custom error type (a subclass of ValueError) so people can have an "official" way to catch these errors.

@pganssle pganssle modified the milestones: 2.7.0, Feature release Jul 16, 2017
@pganssle
pganssle merged commit 34dbe11 into dateutil:master Jul 16, 2017
@pganssle pganssle mentioned this pull request Mar 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants