mirror of
https://github.com/ceph/ceph
synced 2025-03-25 11:48:05 +00:00
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:
commit
d9aac6a55f
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user