Skip to content

Commit

Permalink
api: preserve cause when re-raising error (#3023)
Browse files Browse the repository at this point in the history
Use `from e` to ensure that the error context is propagated
correctly.

Fixes #2702.

Signed-off-by: Milas Bowman <milas.bowman@docker.com>
  • Loading branch information
milas authored Jul 29, 2022
1 parent 23cf16f commit 05e1434
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docker/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def create_api_error_from_http_exception(e):
cls = ImageNotFound
else:
cls = NotFound
raise cls(e, response=response, explanation=explanation)
raise cls(e, response=response, explanation=explanation) from e


class APIError(requests.exceptions.HTTPError, DockerException):
Expand Down

0 comments on commit 05e1434

Please sign in to comment.