Adapt http response error message parsing
Due I05d2bb60b211d1b18611070217b01e3e418eb79a, change the error message parsing to get error message from response. Closes-Bug: #1555985 Change-Id: I4da3aff76fe46d1ac9fd90e06cb4931dc9a8d203
This commit is contained in:
parent
a5381cdd2f
commit
e9c6c1a2a3
@ -44,6 +44,12 @@ def _extract_error_json(body):
|
||||
if 'error_message' in body_json:
|
||||
raw_msg = body_json['error_message']
|
||||
error_json = json.loads(raw_msg)
|
||||
else:
|
||||
error_body = body_json['errors'][0]
|
||||
raw_msg = error_body['title']
|
||||
error_json = {'faultstring': error_body['title'],
|
||||
'debuginfo': error_body['detail']}
|
||||
|
||||
except ValueError:
|
||||
return {}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user