bravado
bravado copied to clipboard
HTTPError inherits from IOError, but should it?
#When we upgraded pylint, is started complaining about
http://pylint-messages.wikidot.com/messages:e0710 Raising a new style class which doesn't inherit from BaseException For the following code:
try:
...
except bravado.exception.HTTPError as exc:
...
This is strange, and maybe a pylint bug, since IOError is an alias for OSError, which inherits from BaseException? Currently, the base class is IOError, but is IOError really the correct base class here? I would argue that HTTP exceptions are a logic level, not an IO level.
https://docs.python.org/2/library/exceptions.html#exceptions.IOError
Raised when an I/O operation (such as a print statement, the built-in open() function or a method of a file object) fails for an I/O-related reason, e.g., “file not found” or “disk full”.
I guess I wanted to open a discussion on the use of IOError here. shrug