Merge "Make exception catching more python3-ish"

This commit is contained in:
Jenkins 2017-01-19 13:25:50 +00:00 committed by Gerrit Code Review
commit 6323afd556
2 changed files with 3 additions and 3 deletions

View File

@ -68,7 +68,7 @@ class FloatingIPController(rest.RestController):
try:
body = request.body_dict
except Exception as e:
if e.message != 'TODO: Unsupported Content Type':
if str(e) != 'TODO: Unsupported Content Type':
raise
else:
# Got a blank body

View File

@ -72,8 +72,8 @@ def filter_exceptions(fn):
except exceptions.Backend as e:
raise e
except Exception as e:
LOG.error(_LE("Unhandled exception %s"), e.message, exc_info=True)
raise exceptions.Backend(e.message)
LOG.error(_LE("Unhandled exception %s"), e, exc_info=True)
raise exceptions.Backend(e)
return wrapper