We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 334b6e6 commit c691283Copy full SHA for c691283
googleapiclient/http.py
@@ -116,7 +116,9 @@ def _should_retry_response(resp_status, content):
116
try:
117
data = json.loads(content.decode("utf-8"))
118
if isinstance(data, dict):
119
- reason = data["error"]["errors"][0]["reason"]
+ reason = data["error"].get("status")
120
+ if reason is None:
121
+ reason = data["error"]["errors"][0]["reason"]
122
else:
123
reason = data[0]["error"]["errors"]["reason"]
124
except (UnicodeDecodeError, ValueError, KeyError):
0 commit comments