Skip to content

Commit 05e1434

Browse files
authored
api: preserve cause when re-raising error (#3023)
Use `from e` to ensure that the error context is propagated correctly. Fixes #2702. Signed-off-by: Milas Bowman <[email protected]>
1 parent 23cf16f commit 05e1434

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docker/errors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def create_api_error_from_http_exception(e):
2828
cls = ImageNotFound
2929
else:
3030
cls = NotFound
31-
raise cls(e, response=response, explanation=explanation)
31+
raise cls(e, response=response, explanation=explanation) from e
3232

3333

3434
class APIError(requests.exceptions.HTTPError, DockerException):

0 commit comments

Comments
 (0)