Browse Source

Polish

pull/21653/head
Phillip Webb 6 years ago
parent
commit
502e2a4c64
  1. 8
      spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/transport/DockerConnectionException.java
  2. 4
      spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/transport/DockerConnectionExceptionTests.java
  3. 4
      spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/packaging-oci-image.adoc

8
spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/transport/DockerConnectionException.java

@ -17,6 +17,7 @@ @@ -17,6 +17,7 @@
package org.springframework.boot.buildpack.platform.docker.transport;
import org.springframework.util.Assert;
import org.springframework.util.StringUtils;
/**
* Exception thrown when connection to the Docker daemon fails.
@ -33,11 +34,11 @@ public class DockerConnectionException extends RuntimeException { @@ -33,11 +34,11 @@ public class DockerConnectionException extends RuntimeException {
}
private static String buildMessage(String host, Exception cause) {
Assert.notNull(host, "host must not be null");
Assert.notNull(cause, "cause must not be null");
Assert.notNull(host, "Host must not be null");
Assert.notNull(cause, "Cause must not be null");
StringBuilder message = new StringBuilder("Connection to the Docker daemon at '" + host + "' failed");
String causeMessage = getCauseMessage(cause);
if (causeMessage != null && !causeMessage.isEmpty()) {
if (StringUtils.hasText(causeMessage)) {
message.append(" with error \"").append(causeMessage).append("\"");
}
message.append("; ensure the Docker daemon is running and accessible");
@ -48,7 +49,6 @@ public class DockerConnectionException extends RuntimeException { @@ -48,7 +49,6 @@ public class DockerConnectionException extends RuntimeException {
if (cause.getCause() != null && cause.getCause().getClass().getName().equals(JNA_EXCEPTION_CLASS_NAME)) {
return cause.getCause().getMessage();
}
return cause.getMessage();
}

4
spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/transport/DockerConnectionExceptionTests.java

@ -35,13 +35,13 @@ class DockerConnectionExceptionTests { @@ -35,13 +35,13 @@ class DockerConnectionExceptionTests {
@Test
void createWhenHostIsNullThrowsException() {
assertThatIllegalArgumentException().isThrownBy(() -> new DockerConnectionException(null, null))
.withMessage("host must not be null");
.withMessage("Host must not be null");
}
@Test
void createWhenCauseIsNullThrowsException() {
assertThatIllegalArgumentException().isThrownBy(() -> new DockerConnectionException(HOST, null))
.withMessage("cause must not be null");
.withMessage("Cause must not be null");
}
@Test

4
spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/packaging-oci-image.adoc

@ -100,7 +100,7 @@ The builder can be specified on the command line as well, as shown in this examp @@ -100,7 +100,7 @@ The builder can be specified on the command line as well, as shown in this examp
[indent=0]
----
$ gradle bootBuildImage --builder=mine/java-cnb-builder
$ gradle bootBuildImage --builder=mine/java-cnb-builder
----
@ -164,5 +164,5 @@ The image name can be specified on the command line as well, as shown in this ex @@ -164,5 +164,5 @@ The image name can be specified on the command line as well, as shown in this ex
[indent=0]
----
$ gradle bootBuildImage --imageName=example.com/library/my-app:v1
$ gradle bootBuildImage --imageName=example.com/library/my-app:v1
----

Loading…
Cancel
Save