exit if keygen on and null config in launcher
@@ -15,6 +15,7 @@ import javax.validation.ConstraintViolation;
import javax.validation.ConstraintViolationException;
import java.net.URI;
import java.util.NoSuchElementException;
+import java.util.Objects;
import java.util.Set;
import java.util.concurrent.CountDownLatch;
@@ -37,7 +38,11 @@ public class Launcher {
System.exit(cliResult.getStatus());
}
- Config config = cliResult.getConfig()
+ if (!cliResult.getConfig().isPresent() && cliResult.isKeyGenOn()) {
+ System.exit(cliResult.getStatus());
+ }
+
+ final Config config = cliResult.getConfig()
.orElseThrow(() -> new NoSuchElementException("No Config found. Tessera will not run"));
final URI uri = new URI(config.getServerConfig().getHostName() + ":" + config.getServerConfig().getPort());
@@ -54,9 +59,6 @@ public class Launcher {
}
System.exit(1);
}
- catch(NoSuchElementException ex) {
- System.exit(1);
- }
}
private static void runWebServer(final URI serverUri, ServerConfig serverConfig) throws Exception {
