2: Swap System.exit from JupiterPerpsAlarmImpl with thrown exceptions
This commit is contained in:
@@ -16,10 +16,9 @@ public final class JupiterPerpsAlarmImpl {
|
||||
try {
|
||||
config = Config.parse(args, System.getenv());
|
||||
} catch (IllegalArgumentException exception) {
|
||||
System.err.println(exception.getMessage());
|
||||
printUsage();
|
||||
System.exit(2);
|
||||
return;
|
||||
String errMsg = "Could not parse configuration for JupiterPerpsAlarm: " + exception.getMessage() + "!";
|
||||
throw new IllegalStateException(errMsg, exception);
|
||||
}
|
||||
|
||||
if (config.selfTest()) {
|
||||
@@ -32,9 +31,8 @@ public final class JupiterPerpsAlarmImpl {
|
||||
try {
|
||||
definitions = AlarmConfigurationParser.parse(config.alarmConfiguration());
|
||||
} catch (Exception exception) {
|
||||
System.err.println("Could not load alarm configuration: " + exception.getMessage());
|
||||
System.exit(2);
|
||||
return;
|
||||
String errMsg = "Could not load alarm configuration: " + exception.getMessage() + "!";
|
||||
throw new IllegalStateException(errMsg, exception);
|
||||
}
|
||||
|
||||
List<AlarmAction> actions = new ArrayList<>();
|
||||
|
||||
Reference in New Issue
Block a user