Commit 03069bfa authored by Cuong Nguyen's avatar Cuong Nguyen

Make exception catching more python3-ish

There are some codes still using e.message for logging with e is the
exception. As e.message is not compatibale with python3, this patch replaces it.

Change-Id: I5b1158aad6d5b6e8875aee8e7e8eba59a13c0409
parent 38f4455f
......@@ -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
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment