Skip to content

Commit bb11197

Browse files
authored
client: fix exception semantics in _raise_for_status (#2954)
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>
1 parent 7168e09 commit bb11197

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docker/api/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ def _raise_for_status(self, response):
267267
try:
268268
response.raise_for_status()
269269
except requests.exceptions.HTTPError as e:
270-
raise create_api_error_from_http_exception(e)
270+
raise create_api_error_from_http_exception(e) from e
271271

272272
def _result(self, response, json=False, binary=False):
273273
assert not (json and binary)

0 commit comments

Comments
 (0)