Fix KeyError when error_body = body_json['errors'][0]

Change-Id: I33a855d173d31a78a8fda9ac8b1c753b71158298
Closes-Bug: #1810908
This commit is contained in:
Feng Shengqin 2019-01-08 17:02:01 +08:00
parent eedf5c7fdd
commit b328c351ba
1 changed files with 1 additions and 1 deletions

View File

@ -51,7 +51,7 @@ def _extract_error_json(body):
error_body = body_json['error']
error_json = {'faultstring': error_body['title'],
'debuginfo': error_body['message']}
else:
elif 'errors' in body_json:
error_body = body_json['errors'][0]
error_json = {'faultstring': error_body['title']}
if 'detail' in error_body: