Skip to content

Commit

Permalink
0006006: Prevented node from starting up if the sync.url is invalid
Browse files Browse the repository at this point in the history
  • Loading branch information
evan-miller-jumpmind committed Oct 6, 2023
1 parent 6385cc3 commit 20ecfcf
Showing 1 changed file with 9 additions and 1 deletion.
Expand Up @@ -27,6 +27,7 @@
import java.lang.reflect.Constructor;
import java.lang.reflect.Method;
import java.net.MalformedURLException;
import java.net.URISyntaxException;
import java.net.URL;
import java.security.UnrecoverableKeyException;
import java.sql.SQLException;
Expand Down Expand Up @@ -996,7 +997,14 @@ public boolean isConfigured() {
log.debug("The current version of {} is newer than the last running version of {}",
Version.version(), node.getSymmetricVersion());
}
configurationValid = true;
try {
new URL(parameterService.getSyncUrl()).toURI();
} catch (MalformedURLException e) {
errorMessage = String.format("The %s property is not a valid URL: %s", ParameterConstants.SYNC_URL, parameterService.getSyncUrl());
} catch (URISyntaxException e) {
errorMessage = String.format("The %s property is not a valid URI: %s", ParameterConstants.SYNC_URL, parameterService.getSyncUrl());
}
configurationValid = (errorMessage == null);
}
if (errorMessage != null) {
log.error(errorMessage);
Expand Down

0 comments on commit 20ecfcf

Please sign in to comment.