Skip to content

fix: wrap socket.error exceptions in ConnectionError#93

Open
label-hook[bot] wants to merge 1391 commits into
mainfrom
phoenix/issue-92
Open

fix: wrap socket.error exceptions in ConnectionError#93
label-hook[bot] wants to merge 1391 commits into
mainfrom
phoenix/issue-92

Conversation

@label-hook

@label-hook label-hook Bot commented Apr 15, 2026

Copy link
Copy Markdown

Summary

This PR addresses issue #92 where raw socket.error exceptions were not being caught and wrapped in requests.exceptions.ConnectionError. Users expect all network-related errors to be wrapped in requests exceptions rather than receiving raw socket errors.

Changes

  • Modified requests/adapters.py to catch socket.error exceptions in the HTTPAdapter.send() method
  • Added socket.error to the existing exception handling block that catches connection-related errors
  • Raw socket errors are now wrapped in requests.exceptions.ConnectionError for consistent error handling

Testing

The changes were tested against the existing test suite. The baseline test suite was already failing, and this implementation introduced no new test failures, indicating that the socket error handling addition is compatible with existing functionality.

Closes #92


Closes #92

Lukasa and others added 30 commits January 9, 2014 19:50
Fixed parsing of username and password encoded in the URI
Document contextlib.closing.
Add a small note about requests-toolbelt
Added info about posted files headers
Fix for 301 redirect and latest PyOpenSSL.
nonZero and others added 26 commits July 15, 2014 19:56
Update link to pip site on docs/user/install.rst
removed unneeded parentheses from if clause
A few instances of the directives were malformed and did not
result in hyperlinks in the generated HTML.

Change-Id: I94d93de928ee4ff24a48797baf2ac77598a20704
…tives

Docs: Fix :class: and :meth: directives
Change-Id: Ied3e600e5673eff48558b634b3c2616d13a3337b
Change-Id: Ic1464f246602b809f3c29fbafd6f36b747d5d5df
Change-Id: Ie38844a40ec7a483e6ce5e56077be344242bcd99
Change-Id: Ic03aa394941367745f3148d299b5313849f77051
The file is empty and not linked from anywhere, resulting in
a warning when building the docs.

Change-Id: Ib995d094ef525496fe8b2a369e0a0c5b4c7bd2dd
Change-Id: I950c3da727fb97b58d96a872b0d2ed718cc60ba8
- Linkify github usernames
- Remove usernames that do not exist

Change-Id: Ib88b70a3010e915b3570ae5062c8cb416c9a6462
Change-Id: Ic88eb128384b3cc9108151c219cd759c7524a4f1
Docs: Using print() function instead print command on advanced & quickstart
Linkify Github usernames in authors list
Removed an unnecessary "to" in the "What are "hostname doesn't match" errors?" section.
Revised wording based on feedback from @sigmavirus24
@label-hook label-hook Bot added the ai:review Phoenix AI: PR ready for review label Apr 15, 2026
@kkipngenokoech kkipngenokoech force-pushed the main branch 2 times, most recently from 36453b9 to a0df2cb Compare April 18, 2026 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai:review Phoenix AI: PR ready for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[SWE-bench] psf__requests-2148