Skip to content

Commit bda5def

Browse files
committed
Jira: Add handling for errorMessages field in JSM responses
1 parent f5c0afa commit bda5def

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

atlassian/service_desk.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -921,7 +921,10 @@ def raise_for_status(self, response):
921921
if 400 <= response.status_code < 600:
922922
try:
923923
j = response.json()
924-
error_msg = j["errorMessage"]
924+
if "errorMessage" in j:
925+
error_msg = j["errorMessage"]
926+
if "errorMessages" in j:
927+
error_msg = ", ".join(j["errorMessages"] or [])
925928
except Exception as e:
926929
log.error(e)
927930
response.raise_for_status()

0 commit comments

Comments
 (0)