Skip to content

Commit 2f2fe9d

Browse files
co-stiggonchik
authored andcommitted
Fix error response without 'errors' field (#972)
1 parent 7a86a69 commit 2f2fe9d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

atlassian/rest_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ def raise_for_status(self, response):
392392
if 400 <= response.status_code < 600:
393393
try:
394394
j = response.json()
395-
error_msg = "\n".join(j["errorMessages"] + [k + ": " + v for k, v in j["errors"].items()])
395+
error_msg = "\n".join(j.get("errorMessages", list()) + [k + ": " + v for k, v in j.get("errors", dict()).items()])
396396
except Exception:
397397
response.raise_for_status()
398398
else:

0 commit comments

Comments
 (0)