Skip to content

Commit 8a2cc94

Browse files
committed
Remove hack now that atlassian-api/atlassian-python-api#1378 was fixed
1 parent 0380475 commit 8a2cc94

File tree

2 files changed

+4
-17
lines changed

2 files changed

+4
-17
lines changed

jbi/jira/client.py

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import json
21
import logging
32
from typing import Collection, Iterable, Optional
43

@@ -64,18 +63,9 @@ def raise_for_status(self, *args, **kwargs):
6463
response.reason,
6564
extra={"body": response.text},
6665
)
67-
if str(exc) == "":
68-
# Some Jira errors are raised as `HTTPError('')`.
69-
# We are trying to turn them into insightful errors here.
70-
try:
71-
content = exc.response.json()
72-
errors = content.get("errors", {})
73-
response_details = ",".join(f"{k}: {v}" for k, v in errors.items())
74-
except json.JSONDecodeError:
75-
response_details = exc.response.text
76-
# Set the exception message so that its str version contains details.
77-
msg = f"HTTP {exc.response.status_code}: {response_details}"
78-
exc.args = (msg,) + exc.args[1:]
66+
# Set the exception message so that its str version contains details.
67+
msg = f"HTTP {exc.response.status_code}: {exc}"
68+
exc.args = (msg,) + exc.args[1:]
7969
raise
8070

8171
get_server_info = instrumented_method(Jira.get_server_info)

tests/unit/test_runner.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -375,10 +375,7 @@ async def test_execute_or_queue_http_error_details(
375375

376376
items = (await dl_queue.retrieve())[bug.id]
377377
[item] = [i async for i in items]
378-
assert (
379-
item.error.description
380-
== "HTTP 400: resolution: Field 'resolution' cannot be set."
381-
)
378+
assert item.error.description == "HTTP 400: Field 'resolution' cannot be set."
382379

383380

384381
def test_default_invalid_init():

0 commit comments

Comments
 (0)