Skip to content

Commit

Permalink
Fix exception semantics in _raise_for_status
Browse files Browse the repository at this point in the history
We want "The above exception was the direct cause of the following exception:" instead of "During handling of the above exception, another exception occurred:"
  • Loading branch information
kmaork authored Feb 21, 2022
1 parent a48a5a9 commit 868f2f9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docker/api/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ def _raise_for_status(self, response):
try:
response.raise_for_status()
except requests.exceptions.HTTPError as e:
raise create_api_error_from_http_exception(e)
raise create_api_error_from_http_exception(e) from e

def _result(self, response, json=False, binary=False):
assert not (json and binary)
Expand Down

0 comments on commit 868f2f9

Please sign in to comment.