Return related error code with ManagerError
For error handler to decide the exact error type, related error code is needed. The field will be empty list if there is not related error Issue: # Change-Id: I53ad9e6da41ab65ea96414753635576c64d5d6d0
This commit is contained in:
@@ -70,6 +70,7 @@ class NsxLibInvalidInput(NsxLibException):
|
||||
class ManagerError(NsxLibException):
|
||||
message = _("Unexpected error from backend manager (%(manager)s) "
|
||||
"for %(operation)s%(details)s")
|
||||
related_error_codes = []
|
||||
|
||||
def __init__(self, **kwargs):
|
||||
details = kwargs.get('details', '')
|
||||
@@ -80,6 +81,7 @@ class ManagerError(NsxLibException):
|
||||
except KeyError:
|
||||
self.msg = details
|
||||
self.error_code = kwargs.get('error_code')
|
||||
self.related_error_codes = kwargs.get('related_error_codes', [])
|
||||
|
||||
|
||||
class ResourceNotFound(ManagerError):
|
||||
|
||||
Reference in New Issue
Block a user