Improve handling of missing (illegal) configuration.

This commit is contained in:
Michael Lipp 2023-08-08 13:06:32 +02:00
parent d74ec52441
commit 0c4cb7e9b4

View file

@ -342,15 +342,16 @@ public class Runner extends Component {
*/
@Handler(priority = 100)
public void onStart(Start event) {
rep = newEventPipeline();
event.setAssociated(EventPipeline.class, rep);
try {
if (config == null) {
// Missing configuration, fail
event.cancel(true);
fire(new Stop());
return;
}
rep = newEventPipeline();
event.setAssociated(EventPipeline.class, rep);
try {
// Store process id
try (var pidFile = Files.newBufferedWriter(
config.runtimeDir.resolve("runner.pid"))) {