question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Feature Request]: raise httpx exception instead of buildin ConnectionResetError and ConnectionError

See original GitHub issue

This 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:closed
  • Created 4 years ago
  • Comments:20 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
tomchristiecommented, Jan 1, 2020

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.

1reaction
trim21commented, Sep 17, 2019

@florimondmanca thanks for your explanation

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Hashnode Post

No results found