Repository navigation
fix: error handling - #479
Conversation
03c94bc to
2cd3511
Compare
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified in the changes to malformed-response handling for the synchronous and asynchronous API clients.
No open issues 🎉
What changed in this PR
This PR hardens the synchronous and asynchronous API clients so malformed responses from custom transports return False rather than propagate exceptions during registration or metrics submission.
Changes:
- Moves response validation and logging inside existing exception handlers.
- Adds regression tests for broken transport responses in both clients.
| File | Description |
|---|---|
UnleashClient/api_client/_sync.py |
Guards registration and metrics response handling against exceptions. |
UnleashClient/api_client/_async.py |
Adds equivalent async safeguards while preserving cancellation handling. |
tests/unit_tests/test_unleash_api_client.py |
Tests that malformed responses return False for both sync operations. |
tests/unit_tests/test_async_unleash_api_client.py |
Tests the same malformed-response behavior for async operations. |
Review effort: Balanced
2cd3511 to
512303e
Compare
ppicom
left a comment
There was a problem hiding this comment.
This makes sense! Left a note on docstrings, but not blocking
There was a problem hiding this comment.
docstrings are no longer accurate. They say only exceptions from the transport become False. Now a response the SDK can't read does too.
There was a problem hiding this comment.
docstrings are no longer accurate. They say only exceptions from the transport become False. Now a response the SDK can't read does too.
512303e to
c754995
Compare
|
fixed docstrings 🙌 |
guarding a little bit more against custom transport bugs, a broken response should not raise into the caller code