client.images.push doesnt raise exception
Hi,
We are using client.images.push to push docker images to Azure ACR. We are facing an internal authorization issue, but expected the API to raise an exception but it does not. It returns the generator str but raising an exception would be optimal here.
I came here to report exactly the same thing. This is kind of a big deal because it results in silent failures.
@milas What do you think?
Also using this API and was surprised that our CI pipeline showed up as green even if the push failed. Turns out this issue is the reason. When attaching a debugger it looked like the HTTP status code was 200. Using AWS ECR. The docker cli returned a non-zero exit code (2) for the same push call.
I was also experiencing the same thing with the following code. If I print the response, I will see the error but the try/catch statement won't detect it.
Engine API doesn't raise error but return JSON with errorDetail and progressDetail [See here]
I am working on PR for this issue and will link soon so, at least a exception is raised in case of failure