Merge "Fix exception handling"
This commit is contained in:
commit
4d762e61b6
@ -56,11 +56,13 @@ class ManagerError(NsxLibException):
|
||||
"for %(operation)s %(details)s")
|
||||
|
||||
def __init__(self, **kwargs):
|
||||
kwargs['details'] = (': %s' % kwargs['details']
|
||||
if 'details' in kwargs
|
||||
else '')
|
||||
details = kwargs.get('details', '')
|
||||
kwargs['details'] = ': %s' % details
|
||||
super(ManagerError, self).__init__(**kwargs)
|
||||
self.msg = self.message % kwargs
|
||||
try:
|
||||
self.msg = self.message % kwargs
|
||||
except KeyError:
|
||||
self.msg = details
|
||||
|
||||
|
||||
class ResourceNotFound(ManagerError):
|
||||
|
Loading…
x
Reference in New Issue
Block a user