From bf2c61f72220b7c5df0df658da7bd353af8eb915 Mon Sep 17 00:00:00 2001 From: Andy Clement Date: Tue, 10 Nov 2020 09:34:11 -0800 Subject: [PATCH] Do not discard the root exception when things go wrong The root exception can detail an important root cause. For example with native-images it can indicate a flag you need to set for the native-image to compile correctly: Caused by: java.net.MalformedURLException: Accessing an URL protocol that was not enabled. The URL protocol http is supported but not enabled by default. It must be enabled by adding the -H:EnableURLProtocols=http option to the native-image command. --- .../cloud/config/client/ConfigClientProperties.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-cloud-config-client/src/main/java/org/springframework/cloud/config/client/ConfigClientProperties.java b/spring-cloud-config-client/src/main/java/org/springframework/cloud/config/client/ConfigClientProperties.java index fbc10ac6..147a8af8 100644 --- a/spring-cloud-config-client/src/main/java/org/springframework/cloud/config/client/ConfigClientProperties.java +++ b/spring-cloud-config-client/src/main/java/org/springframework/cloud/config/client/ConfigClientProperties.java @@ -336,7 +336,7 @@ public class ConfigClientProperties { return result; } catch (MalformedURLException e) { - throw new IllegalStateException("Invalid URL: " + uri); + throw new IllegalStateException("Invalid URL: " + uri, e); } }