Improve handling of missing (illegal) configuration.
This commit is contained in:
parent
d74ec52441
commit
0c4cb7e9b4
1 changed files with 7 additions and 6 deletions
|
|
@ -342,15 +342,16 @@ public class Runner extends Component {
|
||||||
*/
|
*/
|
||||||
@Handler(priority = 100)
|
@Handler(priority = 100)
|
||||||
public void onStart(Start event) {
|
public void onStart(Start event) {
|
||||||
|
if (config == null) {
|
||||||
|
// Missing configuration, fail
|
||||||
|
event.cancel(true);
|
||||||
|
fire(new Stop());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
rep = newEventPipeline();
|
rep = newEventPipeline();
|
||||||
event.setAssociated(EventPipeline.class, rep);
|
event.setAssociated(EventPipeline.class, rep);
|
||||||
try {
|
try {
|
||||||
if (config == null) {
|
|
||||||
// Missing configuration, fail
|
|
||||||
fire(new Stop());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Store process id
|
// Store process id
|
||||||
try (var pidFile = Files.newBufferedWriter(
|
try (var pidFile = Files.newBufferedWriter(
|
||||||
config.runtimeDir.resolve("runner.pid"))) {
|
config.runtimeDir.resolve("runner.pid"))) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue