From 090d655527b962e8ccb8ed58178a954cd1ad4456 Mon Sep 17 00:00:00 2001 From: Louis Murerwa Date: Mon, 29 Jun 2020 15:20:46 +0000 Subject: [PATCH] Fixed the error the styling errors --- .../cloud/tools/jib/registry/RegistryEndpointCaller.java | 5 ++--- .../cloud/tools/jib/registry/RegistryEndpointCallerTest.java | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/jib-core/src/main/java/com/google/cloud/tools/jib/registry/RegistryEndpointCaller.java b/jib-core/src/main/java/com/google/cloud/tools/jib/registry/RegistryEndpointCaller.java index b2dd88b345..cc0af21f93 100644 --- a/jib-core/src/main/java/com/google/cloud/tools/jib/registry/RegistryEndpointCaller.java +++ b/jib-core/src/main/java/com/google/cloud/tools/jib/registry/RegistryEndpointCaller.java @@ -46,8 +46,7 @@ class RegistryEndpointCaller { /** - * https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/308. + * https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/308. */ @VisibleForTesting static final int STATUS_CODE_PERMANENT_REDIRECT = 308; @@ -208,7 +207,7 @@ RegistryErrorException newRegistryErrorException(ResponseException responseExcep registryErrorExceptionBuilder.addReason( "registry returned error code " + responseException.getStatusCode() - + "; possible causes include invalid or wrong reference \n"); + + "; but did not return any details; possible causes include invalid or wrong reference, or proxy/firewall/VPN interfering \n"); } return registryErrorExceptionBuilder.build(); } diff --git a/jib-core/src/test/java/com/google/cloud/tools/jib/registry/RegistryEndpointCallerTest.java b/jib-core/src/test/java/com/google/cloud/tools/jib/registry/RegistryEndpointCallerTest.java index ee71fe8599..b242f4e1ad 100644 --- a/jib-core/src/test/java/com/google/cloud/tools/jib/registry/RegistryEndpointCallerTest.java +++ b/jib-core/src/test/java/com/google/cloud/tools/jib/registry/RegistryEndpointCallerTest.java @@ -436,7 +436,7 @@ public void testNewRegistryErrorException_nonJsonErrorOutput() { } @Test - public void testNewRegistryErrorException_nullJsonErrorOutput() { + public void testNewRegistryErrorException_noOutputFromRegistry() { ResponseException httpException = Mockito.mock(ResponseException.class); // Registry returning null error output Mockito.when(httpException.getContent()).thenReturn(null); @@ -447,7 +447,7 @@ public void testNewRegistryErrorException_nullJsonErrorOutput() { Assert.assertSame(httpException, registryException.getCause()); Assert.assertEquals( "Tried to actionDescription but failed because: registry returned error code 404; " - + "possible causes include invalid or wrong reference \n" + + "but did not return any details; possible causes include invalid or wrong reference, or proxy/firewall/VPN interfering \n" + " | If this is a bug, please file an issue at " + "https://github.com/GoogleContainerTools/jib/issues/new", registryException.getMessage());