mirror of https://github.com/docker/docker-py.git
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 <milas.bowman@docker.com>
This commit is contained in:
parent
23cf16f03a
commit
05e143429e
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue