Java Code Examples for com.spotify.docker.client.messages.ProgressMessage#error()
The following examples show how to use
com.spotify.docker.client.messages.ProgressMessage#error() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DockerProgressHandler.java From docker-registry-artifact-plugin with Apache License 2.0 | 6 votes |
@Override public void progress(ProgressMessage message) { if (StringUtils.isNotBlank(message.error())) { consoleLogger.error(message.error()); LOG.error(format("Failure: %s", message.error())); throw new RuntimeException(message.error()); } if (StringUtils.isNotBlank(message.progress())) { consoleLogger.info(message.progress()); } if (StringUtils.isNotBlank(message.digest())) { digest = message.digest(); } }
Example 2
Source File: AnsiProgressHandler.java From docker-client with Apache License 2.0 | 6 votes |
@Override public void progress(ProgressMessage message) throws DockerException { if (message.error() != null) { throw new DockerException(message.error()); } if (message.progressDetail() != null) { printProgress(message); return; } String value = message.stream(); if (value != null) { // trim trailing new lines which are present in streams value = value.replaceFirst("\n$", ""); } else { value = message.status(); } // if value is null it's an unknown message type so just print the whole thing out if (value == null) { value = message.toString(); } out.println(value); }
Example 3
Source File: LoggingProgressHandler.java From dockerfile-maven with Apache License 2.0 | 5 votes |
@Override public void progress(ProgressMessage message) throws DockerException { if (message.error() != null) { handleError(message.error()); } else if (message.progressDetail() != null) { handleProgress(message.id(), message.status(), message.progress()); } else if ((message.status() != null) || (message.stream() != null)) { handleGeneric(message.stream(), message.status()); } String imageId = message.buildImageId(); if (imageId != null) { builtImageId = imageId; } }
Example 4
Source File: LoggingLoadHandler.java From docker-client with Apache License 2.0 | 5 votes |
@Override public void progress(ProgressMessage message) throws DockerException { if (message.error() != null) { throw new DockerException(message.toString()); } log.info("load: {}", message); }
Example 5
Source File: LoggingBuildHandler.java From docker-client with Apache License 2.0 | 5 votes |
@Override public void progress(ProgressMessage message) throws DockerException { if (message.error() != null) { throw new DockerException(message.toString()); } log.info("build: {}", message); }
Example 6
Source File: LoggingPullHandler.java From docker-client with Apache License 2.0 | 5 votes |
@Override public void progress(ProgressMessage message) throws DockerException { if (message.error() != null) { if (message.error().contains("404") || message.error().contains("not found")) { throw new ImageNotFoundException(image, message.toString()); } else { throw new ImagePullFailedException(image, message.toString()); } } log.info("pull {}: {}", image, message); }
Example 7
Source File: LoggingPushHandler.java From docker-client with Apache License 2.0 | 5 votes |
@Override public void progress(ProgressMessage message) throws DockerException { if (message.error() != null) { throw new ImagePushFailedException(image, message.toString()); } log.info("push {}: {}", image, message); }