Parse exception from SDK
Some exceptions from SDK are not in stardard json format, this patch parse it to json. Change-Id: If39704f24b084cd1f6aaccd3c951636a53f3ddc1 Partial-Bug: #1472557
This commit is contained in:
@@ -231,7 +231,12 @@ def parse_exception(exc):
|
|||||||
:param details: details of the exception.
|
:param details: details of the exception.
|
||||||
'''
|
'''
|
||||||
if isinstance(exc, sdkexc.HttpException):
|
if isinstance(exc, sdkexc.HttpException):
|
||||||
record = jsonutils.loads(exc.details)
|
record = {
|
||||||
|
'error': {
|
||||||
|
'code': exc.status_code,
|
||||||
|
'message': exc.details,
|
||||||
|
}
|
||||||
|
}
|
||||||
elif isinstance(exc, reqexc.RequestException):
|
elif isinstance(exc, reqexc.RequestException):
|
||||||
# Exceptions that are not captured by SDK
|
# Exceptions that are not captured by SDK
|
||||||
code = exc.message[1].errno
|
code = exc.message[1].errno
|
||||||
|
Reference in New Issue
Block a user