diff --git a/validator/client/src/main/java/tech/pegasys/teku/validator/client/proposerconfig/loader/ProposerConfigLoader.java b/validator/client/src/main/java/tech/pegasys/teku/validator/client/proposerconfig/loader/ProposerConfigLoader.java index 63a5c3cb32a..291be3dba0b 100644 --- a/validator/client/src/main/java/tech/pegasys/teku/validator/client/proposerconfig/loader/ProposerConfigLoader.java +++ b/validator/client/src/main/java/tech/pegasys/teku/validator/client/proposerconfig/loader/ProposerConfigLoader.java @@ -18,6 +18,7 @@ import java.io.IOException; import java.net.URL; import tech.pegasys.teku.infrastructure.exceptions.InvalidConfigurationException; +import tech.pegasys.teku.infrastructure.http.UrlSanitizer; import tech.pegasys.teku.provider.JsonProvider; import tech.pegasys.teku.validator.client.ProposerConfig; @@ -34,19 +35,22 @@ public ProposerConfigLoader(final ObjectMapper objectMapper) { public ProposerConfig getProposerConfig(final File source) { try { - final ProposerConfig proposerConfig = objectMapper.readValue(source, ProposerConfig.class); - return proposerConfig; + return objectMapper.readValue(source, ProposerConfig.class); } catch (IOException ex) { - throw new InvalidConfigurationException("Failed to proposer config from File " + source, ex); + throw new InvalidConfigurationException( + "Failed to load proposer config from file: " + source, ex); } } public ProposerConfig getProposerConfig(final URL source) { try { - final ProposerConfig proposerConfig = objectMapper.readValue(source, ProposerConfig.class); - return proposerConfig; + return objectMapper.readValue(source, ProposerConfig.class); } catch (IOException ex) { - throw new InvalidConfigurationException("Failed to proposer config from URL " + source, ex); + + throw new InvalidConfigurationException( + "Failed to load proposer config from URL:" + + UrlSanitizer.sanitizePotentialUrl(source.toString()), + ex); } } }