Skip to content

fix(client): keep the message of timeouts and connection errors - #270

Open
pcbeingused33 wants to merge 1 commit into
checkout:mainfrom
pcbeingused33:fix/connection-error-message
Open

pcbeingused33 wants to merge 1 commit into
checkout:mainfrom
pcbeingused33:fix/connection-error-message

Conversation

@pcbeingused33

Copy link
Copy Markdown

Problem

When a request times out or the connection fails, the SDK raises a CheckoutException whose message is empty, so str(e) and the logs say nothing about what went wrong.

ApiClient.invoke() wraps transport failures with:

except OSError as err:
    error = err.strerror
    raise CheckoutException(error) from err

requests.exceptions.RequestException inherits from IOError (OSError), but ConnectionError, ConnectTimeout, ReadTimeout, etc. are built from a message or an inner exception, not from (errno, strerror). For them err.strerror is None, and CheckoutException(None) turns that into "". The original error is only reachable through __cause__.

Fix

Fall back to str(err) when strerror is not set. OS-level errors that do carry a strerror (for example a missing upload file) keep the message they had before.

Test

tests/exception_test.py gets a parametrized test that makes the HTTP client raise ConnectTimeout, ConnectionError and ReadTimeout and checks that the CheckoutException carries the transport error's message (it fails on main with '' == '...'), plus a test that a plain OSError with strerror still reports it. The new tests build their own mocked client, so they need no sandbox credentials. flake8 and pylint are clean on the touched files.


This PR was prepared with the help of an AI coding assistant (Claude Code).

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>
@agent-wall-e

agent-wall-e Bot commented Nov 28, 2026

Copy link
Copy Markdown

🟢 Risk Classification: LOW

Approval route: AI Auto-Approval
Rollback controls: Automated Instant Rollback + feature flags

Classification reasons

  • no_low_class_matched
  • prod_source_modified
  • 2.2.6_logical_extension:Single-line bug fix that preserves existing function signature and behavior by falling back to str(err) when strerror is None, with no new endpoints, auth changes, persisted data, or external integrations.

Operational gates

  • ✅ jira_ticket
  • ✅ independent_review

Files analysed: 2


wall-e 2026.06.19-02 · policy 6b4ce2b3b45a…

@agent-wall-e

agent-wall-e Bot commented Nov 28, 2026

Copy link
Copy Markdown
🔬 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.

Reason code Kind Clause Meaning
no_low_class_matched informational §2.2 (fall-through) None of the deterministic Low classes (§2.2.3, §2.2.4, §2.2.7, docs-only) applied; classifier fell through to LLM evaluation.
prod_source_modified informational §2.1 M7 (informational) At least one file is non-doc, non-test, non-IaC — i.e. application source code was modified.
2.2.6_logical_extension — Single-line bug fix that preserves existing function signature and behavior by falling back to str(err) when strerror is None, with no new endpoints, auth changes, persisted data, or external integrations. classifying §2.2.6 Sonnet 4.6 evaluator promoted minor → low: the change reuses existing code paths and does not cross a trust boundary.

Kinds:

  • classifying — this rule contributed to the chosen tier.
  • informational — context only; did not by itself decide the tier.

See issue #3 for the proposal to formalise this map as Appendix A of the standards doc.

wall-e 2026.06.19-02 · debug

@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant