Closed Darkheir closed 6 years ago
That is a good idea. I would rather call it BaseIpwhoisException. Note the case; I don't want to associate it with the IPWhois class, as a lot of those exceptions are for other classes.
Keep in mind that not everything in the library is going to raise a custom exception. Without looking, I know it is raising some of the built-ins like ValueError, KeyError, etc. This solution won't account for those.
Yes it's true but this is a good, It will catch exception that are related with the domain of the lib (wrong ip, ...)
Merged
I think it would be interesting to make all the exception inherit from a base one,
IPWhoisError
for example. It would makes it easier to catch all the exception of the module without having to catch everything.If you are up for it I can submit a pull request.