Skip to content

Commit

Permalink
client: fix exception semantics in _raise_for_status (#2954)
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:"

Signed-off-by: Maor Kleinberger <kmaork@gmail.com>
  • Loading branch information
kmaork committed Jul 26, 2022
1 parent 7168e09 commit bb11197
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 bb11197

Please sign in to comment.