Terry Reedy <tjreedy at udel.edu> writes: > On 12/12/2012 10:56 AM, Lennart Regebro wrote: > > >> It seems like calling get_timezone() with an unknown timezone > >> should just throw ValueError, not necessarily some custom > >> Exception? > > > > That could very well be. What are others opinions on this? > > ValueError. That is what it is. Nothing special here. I think it's useful to have this raise a custom exception UnknownTimeZoneError, subclassed from ValueError. That satisfies those (including me!) who think it should be a ValueError, while also making the exception more specific so it can be handled apart from other possible ValueError causes. In short: +1 to ‘class UnknownTimeZoneError(ValueError)’. -- \ “Members of the general public commonly find copyright rules | `\ implausible, and simply disbelieve them.” —Jessica Litman, | _o__) _Digital Copyright_ | Ben Finney
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4