HttpClientTransport
has the following code:
private Response execute(HttpUriRequest request) {
try {
beforeExecute(request);
ClassicHttpResponse response = this.client.executeOpen(this.host, request, null);
int statusCode = response.getCode();
if (statusCode >= 400 && statusCode <= 500) {
byte[] content = readContent(response);
response.close();
Errors errors = (statusCode != 500) ? deserializeErrors(content) : null;
Message message = deserializeMessage(content);
throw new DockerEngineException(this.host.toHostString(), request.getUri(), statusCode,
response.getReasonPhrase(), errors, message);
}
return new HttpClientResponse(response);
}
catch (IOException | URISyntaxException ex) {
throw new DockerConnectionException(this.host.toHostString(), ex);
}
}
But it appears that Docker returns 407 response with a plain text message when Enforced Sign-In is required. It would be helpful if we could surface that error.