Sync oslo apiclient.exceptions module
Changes - * Handle non-openstack errors gracefully Change-Id: I6a4fc3497aef829294d4e37850530bb455341a79
This commit is contained in:
@@ -447,8 +447,8 @@ def from_response(response, method, url):
|
||||
except ValueError:
|
||||
pass
|
||||
else:
|
||||
if isinstance(body, dict):
|
||||
error = list(body.values())[0]
|
||||
if isinstance(body, dict) and isinstance(body.get("error"), dict):
|
||||
error = body["error"]
|
||||
kwargs["message"] = error.get("message")
|
||||
kwargs["details"] = error.get("details")
|
||||
elif content_type.startswith("text/"):
|
||||
|
||||
Reference in New Issue
Block a user