From 6a521fbd8958950de5ce59106eb086d6a9ffd558 Mon Sep 17 00:00:00 2001 From: Andrey Oleynik Date: Sun, 21 Apr 2024 15:51:35 +0300 Subject: [PATCH] fix missing error msg --- atlassian/rest_client.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/atlassian/rest_client.py b/atlassian/rest_client.py index e92baa7f7..bfe1096a7 100644 --- a/atlassian/rest_client.py +++ b/atlassian/rest_client.py @@ -537,7 +537,9 @@ def raise_for_status(self, response): else: error_msg_list = j.get("errorMessages", list()) errors = j.get("errors", dict()) - if isinstance(errors, dict): + if isinstance(errors, dict) and "message" not in errors: + error_msg_list.extend(errors.values()) + elif isinstance(errors, dict) and "message" in errors: error_msg_list.append(errors.get("message", "")) elif isinstance(errors, list): error_msg_list.extend([v.get("message", "") if isinstance(v, dict) else v for v in errors])