Skip to content

fix: wrap socket.error exceptions in ConnectionError for consistent exception handling#87

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

fix: wrap socket.error exceptions in ConnectionError for consistent exception handling#87
label-hook[bot] wants to merge 1391 commits into
mainfrom
phoenix/issue-86

Conversation

@label-hook

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

Copy link
Copy Markdown

Summary

This PR addresses issue #86 where socket.error exceptions were not being caught and wrapped in requests.exceptions.ConnectionError, leading to inconsistent exception handling when using the requests library.

Changes

  • Added socket.error to the list of exceptions caught in HTTPAdapter.send() method
  • Socket errors are now wrapped as requests.exceptions.ConnectionError for consistent API behavior
  • This aligns with the existing pattern of wrapping low-level network exceptions in requests-specific exceptions

Testing

The changes were tested to ensure:

  • Socket errors are properly caught and wrapped as ConnectionError
  • Existing exception handling behavior remains unchanged
  • No regressions were introduced to the baseline test suite

Closes #86


Closes #86

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