diff --git a/jbi/jira/client.py b/jbi/jira/client.py index c12592a7..8de7efef 100644 --- a/jbi/jira/client.py +++ b/jbi/jira/client.py @@ -64,7 +64,7 @@ def raise_for_status(self, *args, **kwargs): extra={"body": response.text}, ) # Set the exception message so that its str version contains details. - msg = f"HTTP {exc.response.status_code}: {exc}" + msg = f"{request.method} {request.path_url} -> HTTP {response.status_code}: {exc}" exc.args = (msg,) + exc.args[1:] raise diff --git a/tests/unit/test_runner.py b/tests/unit/test_runner.py index 915abf9c..5314bffb 100644 --- a/tests/unit/test_runner.py +++ b/tests/unit/test_runner.py @@ -375,7 +375,10 @@ async def test_execute_or_queue_http_error_details( items = (await dl_queue.retrieve())[bug.id] [item] = [i async for i in items] - assert item.error.description == "HTTP 400: Field 'resolution' cannot be set." + assert ( + item.error.description + == "POST /rest/api/2/issue/TEST-1/remotelink -> HTTP 400: Field 'resolution' cannot be set." + ) def test_default_invalid_init():