Skip to content

Commit

Permalink
Merge pull request #11924 from cescoffier/features/add-global-execept…
Browse files Browse the repository at this point in the history
…ion-handler-for-vertx

Register a global exception handler on the Vert.x instance so uncaught exceptions are logged properly.
  • Loading branch information
stuartwdouglas authored Sep 7, 2020
2 parents 12b033e + 716fcbc commit aae9335
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,12 @@ public static Vertx initialize(VertxConfiguration conf, VertxOptionsCustomizer c
} else {
vertx = Vertx.vertx(options);
}
vertx.exceptionHandler(new Handler<Throwable>() {
@Override
public void handle(Throwable error) {
LOGGER.error("Uncaught exception received by Vert.x", error);
}
});
return logVertxInitialization(vertx);
}

Expand Down

0 comments on commit aae9335

Please sign in to comment.