Parse exceptions from openstacksdk

When parsing exceptions from openstacksdk, exc.details is
desired to contain error message, but sometimes error may
exist in exc.message. Openstacksdk's HttpException has __str__
method to handle error message, so in senlinclient HttpException
object can show the right error message.

Change-Id: I9246ed3d47151ebb8e03cd13134d58749cd35785
Closes-bug: #1541217
This commit is contained in:
xu-haiwei
2016-02-03 14:58:46 +09:00
parent 44bff75c29
commit 2e22adb641

View File

@@ -240,7 +240,7 @@ def parse_exception(exc):
record = {
'error': {
'code': exc.http_status,
'message': exc.details,
'message': exc,
}
}
elif isinstance(exc, reqexc.RequestException):