Skip to content

Commit badc5b6

Browse files
bcicenshin-
authored andcommitted
Add raise_for_status check to push and pull methods
as underlying exceptions(such as push already in progress) will be hidden in the stream generator otherwise.
1 parent 5fa7576 commit badc5b6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

docker/client.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -914,6 +914,8 @@ def pull(self, repository, tag=None, stream=False,
914914
response = self._post(self._url('/images/create'), params=params,
915915
headers=headers, stream=stream, timeout=None)
916916

917+
self._raise_for_status(response)
918+
917919
if stream:
918920
return self._stream_helper(response)
919921
else:
@@ -950,6 +952,8 @@ def push(self, repository, tag=None, stream=False,
950952
else:
951953
response = self._post_json(u, None, stream=stream, params=params)
952954

955+
self._raise_for_status(response)
956+
953957
return stream and self._stream_helper(response) \
954958
or self._result(response)
955959

0 commit comments

Comments
 (0)