Open dermeister opened 2 years ago
And/Or, the JSONMessage needs to be updated to have a "message" field so that we can get the error from progress. Either way, can confirm that errors from Build and Create (and likely others) are basically being eaten. The only indication that anything went wrong was that nothing was return but a single hit to IProgress with an empty JSONMessage.
I don't think that updating JSONMessage is a good idea, because it's generated from Docker sources and should be in sync with it. Plus, it would be inconsistent way of exception handling if we consider other API methods.
@galvesribeiro We can close this issue.
@galvesribeiro , I'm still new on GitHub process here, so do you know who will trigger a new release build so that the fix can be available to the official nuget packages? 😀
Usually it depends how urgent the issue is. If it is not critical (like in this case) we probably collect some more fixes and publish them together. @galvesribeiro will do the release at some point.
Output of
dotnet --info
:What version of Docker.DotNet?:
Steps to reproduce the issue:
What actually happened?: BuildImageFromDockerfileAsync doesn't throw any exception. Instead, it ignores status code and reports everything to IProgress instance. When Dockerfile contains syntax errors, docker daemon responds with status code 400 and body which cannot be deserialized to JSONMessage (it contains only "message" field), so it's impossible to handle exceptions from building image.
What did you expect to happen?: BuildImageFromDockerfileAsync should throw exception if daemon responds with error.