Skip to content

Commit

Permalink
fix: pass response (self) to ConnectionError constructor
Browse files Browse the repository at this point in the history
As far as I can tell, this is the only internal construction of `ConnectionError` that doesn't include `request` or `response`.

Part of improving typing for exceptions in requests: python/typeshed#8989
  • Loading branch information
ErikBjare authored Oct 26, 2022
1 parent 1e62a3e commit da11e3f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion requests/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -819,7 +819,7 @@ def generate():
except DecodeError as e:
raise ContentDecodingError(e)
except ReadTimeoutError as e:
raise ConnectionError(e)
raise ConnectionError(e, response=self)
except SSLError as e:
raise RequestsSSLError(e)
else:
Expand Down

0 comments on commit da11e3f

Please sign in to comment.