Skip to content

Commit

Permalink
fix: catch exceptions during startup
Browse files Browse the repository at this point in the history
  • Loading branch information
ggrossetie committed Oct 21, 2024
1 parent 16896bb commit 695372c
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions server/src/main/java/io/kroki/server/Server.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,17 @@ public void start(Promise<Void> startPromise) {
if (configResult.failed()) {
startPromise.fail(configResult.cause());
} else {
start(vertx, vertxOptions, configResult.result(), startResult -> {
if (startResult.succeeded()) {
startPromise.complete();
} else {
startPromise.fail(startResult.cause());
}
});
try {
start(vertx, vertxOptions, configResult.result(), startResult -> {
if (startResult.succeeded()) {
startPromise.complete();
} else {
startPromise.fail(startResult.cause());
}
});
} catch (Exception e) {
startPromise.fail(e);
}
}
});
}
Expand Down

0 comments on commit 695372c

Please sign in to comment.