Skip to content

Commit 9b023ed

Browse files
committed
fix: address PR review comments for httpx migration
- Remove unused error_message variable in exception handlers - Restore error assertion in test_multiple_account_ids_mixed_success
1 parent 12202e8 commit 9b023ed

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

stackone_ai/models.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,6 @@ def execute(
255255
raise ValueError(error_message) from exc
256256
except httpx.HTTPStatusError as exc:
257257
status = "error"
258-
error_message = str(exc)
259258
response_body = None
260259
if exc.response.text:
261260
try:
@@ -269,7 +268,6 @@ def execute(
269268
) from exc
270269
except httpx.RequestError as exc:
271270
status = "error"
272-
error_message = str(exc)
273271
raise StackOneError(f"Request failed: {exc}") from exc
274272
finally:
275273
datetime.now(timezone.utc)

tests/test_feedback.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,8 @@ def custom_side_effect(request: httpx.Request) -> httpx.Response:
200200

201201
error_result = next(r for r in result["results"] if r["account_id"] == "acc_unauthorized")
202202
assert error_result["status"] == "error"
203+
assert "error" in error_result
204+
assert "401" in error_result["error"]
203205

204206
def test_tool_integration(self) -> None:
205207
"""Test that feedback tool integrates properly with toolset."""

0 commit comments

Comments
 (0)