Skip to content

Commit 575bf11

Browse files
authored
Show method + URL on Jira exceptions (#1101)
1 parent 84b0b7c commit 575bf11

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

jbi/jira/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def raise_for_status(self, *args, **kwargs):
6464
extra={"body": response.text},
6565
)
6666
# Set the exception message so that its str version contains details.
67-
msg = f"HTTP {exc.response.status_code}: {exc}"
67+
msg = f"{request.method} {request.path_url} -> HTTP {response.status_code}: {exc}"
6868
exc.args = (msg,) + exc.args[1:]
6969
raise
7070

tests/unit/test_runner.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,10 @@ 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 item.error.description == "HTTP 400: Field 'resolution' cannot be set."
378+
assert (
379+
item.error.description
380+
== "POST /rest/api/2/issue/TEST-1/remotelink -> HTTP 400: Field 'resolution' cannot be set."
381+
)
379382

380383

381384
def test_default_invalid_init():

0 commit comments

Comments
 (0)