Merge pull request #21853 from rishabh-d-dave/volclient-keyargs-for-all-exceptions

rados.pyx: make all exceptions accept keyword arguments

Reviewed-by: Josh Durgin <jdurgin@redhat.com>
This commit is contained in:
Kefu Chai 2018-05-10 17:30:22 +08:00 committed by GitHub
commit d9aac6a55f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -326,21 +326,12 @@ ADMIN_AUID = 0
class Error(Exception):
""" `Error` class, derived from `Exception` """
pass
class InvalidArgumentError(Error):
pass
class OSError(Error):
""" `OSError` class, derived from `Error` """
def __init__(self, message, errno=None):
super(OSError, self).__init__(message)
super(Exception, self).__init__(message)
self.errno = errno
def __str__(self):
msg = super(OSError, self).__str__()
msg = super(Exception, self).__str__()
if self.errno is None:
return msg
return '[errno {0}] {1}'.format(self.errno, msg)
@ -348,6 +339,13 @@ class OSError(Error):
def __reduce__(self):
return (self.__class__, (self.message, self.errno))
class InvalidArgumentError(Error):
pass
class OSError(Error):
""" `OSError` class, derived from `Error` """
pass
class InterruptedOrTimeoutError(OSError):
""" `InterruptedOrTimeoutError` class, derived from `OSError` """
pass