Merge "Fix exception handling"

This commit is contained in:
Jenkins 2016-11-28 08:30:45 +00:00 committed by Gerrit Code Review
commit 4d762e61b6
1 changed files with 6 additions and 4 deletions

View File

@ -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):