Repository navigation
fix(client): keep the message of timeouts and connection errors - #270
Open
pcbeingused33 wants to merge 1 commit into
Open
pcbeingused33 wants to merge 1 commit into
pcbeingused33 wants to merge 1 commit into
Conversation
requests' transport errors are OSError subclasses built without errno/strerror, so err.strerror is None and CheckoutException ended up with an empty message. Fall back to str(err) when strerror is missing. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
🟢 Risk Classification: LOWApproval route: AI Auto-Approval Classification reasons
Operational gates
Files analysed: 2 wall-e 2026.06.19-02 · policy |
🔬 Debug — why this classification?Each reason code emitted by the classifier, its source clause in the AI in SDLC Control Framework, and what it means.
Kinds:
See issue #3 for the proposal to formalise this map as Appendix A of the standards doc. wall-e 2026.06.19-02 · debug |
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Problem
When a request times out or the connection fails, the SDK raises a
CheckoutExceptionwhose message is empty, sostr(e)and the logs say nothing about what went wrong.ApiClient.invoke()wraps transport failures with:requests.exceptions.RequestExceptioninherits fromIOError(OSError), butConnectionError,ConnectTimeout,ReadTimeout, etc. are built from a message or an inner exception, not from(errno, strerror). For themerr.strerrorisNone, andCheckoutException(None)turns that into"". The original error is only reachable through__cause__.Fix
Fall back to
str(err)whenstrerroris not set. OS-level errors that do carry astrerror(for example a missing upload file) keep the message they had before.Test
tests/exception_test.pygets a parametrized test that makes the HTTP client raiseConnectTimeout,ConnectionErrorandReadTimeoutand checks that theCheckoutExceptioncarries the transport error's message (it fails onmainwith'' == '...'), plus a test that a plainOSErrorwithstrerrorstill reports it. The new tests build their own mocked client, so they need no sandbox credentials.flake8andpylintare clean on the touched files.This PR was prepared with the help of an AI coding assistant (Claude Code).