Skip to content

Commit

Permalink
api: preserve cause when re-raising error
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.
  • Loading branch information
milas committed Jul 28, 2022
1 parent be942f8 commit 292b423
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 292b423

Please sign in to comment.