Skip to content

Commit

Permalink
0006007: 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 853746a commit 388db0a
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
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 @@ -984,7 +985,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 388db0a

Please sign in to comment.