[Feature Request]: raise httpx exception instead of buildin ConnectionResetError and ConnectionError
See original GitHub issueThis is a feature requests instead of bug report.
I’m using requests
in my web server to request upstream api. So I can handler all requests.RequestException
in my middleware and return a 502 upstream
error.
But after I migrated to httpx
, httpx doesn’t have such exception when issuing a http(s) request, it will raise httpx.ConnectTimeout
, buildin ConnectionError
and ConnectResetError
. And last 2 exception are not only raised by httpx
.
Maybe httpx
should also wrap ConnectionError
and other buildin connection exception?
Issue Analytics
- State:
- Created 4 years ago
- Comments:20 (13 by maintainers)
Top Results From Across the Web
Exceptions - HTTPX
This page lists exceptions that may be raised when using HTTPX. For an overview of how to work with HTTPX exceptions, see Exceptions...
Read more >Built-in Exceptions — Python 3.11.1 documentation
A subclass of ConnectionError , raised when a connection attempt is refused by the peer. Corresponds to errno ECONNREFUSED . exception ConnectionResetError ......
Read more >HTTPX: Help Build The Future Of Python HTTP
HTTPX is part of a growing ecosystem of async-capable Python projects lead ... [Feature Request]: raise httpx exception instead of buildin ...
Read more >XGboost keeps failing in Latest H2O stable release
CONTINUE: ~/anaconda3/lib/python3.6/http/client.py in ... 490 raise ConnectionError(err, request=request) 491 ConnectionError: ('Connection ...
Read more >Unable to connect to LDAP over SSL - Atlassian Community
I am able to connect using Softerra LDAP Client so I know the AD SSL setup is good. The firewall ports are open....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
Top Related Hashnode Post
No results found
Top GitHub Comments
Really we want to wrap as close to the exception as possible. Ie. Specifying what exceptions we expect from our backend
.read()
,.write()
and connection methods, and making sure we’re wrapping at that level.@florimondmanca thanks for your explanation