From bb11197ee3407798a53c50e43aa994fe8cd9c8e7 Mon Sep 17 00:00:00 2001 From: Maor Kleinberger Date: Tue, 26 Jul 2022 22:07:23 +0300 Subject: [PATCH] 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 --- docker/api/client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/api/client.py b/docker/api/client.py index 2667922d..7733d334 100644 --- a/docker/api/client.py +++ b/docker/api/client.py @@ -267,7 +267,7 @@ class APIClient( 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)