exception handling in Vert.x - vertx command line
authenticationProvider.authenticate(authInfo)
.onSuccess(user -> {
System.out.println("User " + user.principal() + " is now authenticated");
})
.onFailure(Throwable::printStackTrace);
In case of Internal Server Error (ie status code 500), you can catch them with an errorHandler
router.errorHandler(500, rc -> {
System.err.println("Handling failure");
Throwable failure = rc.failure();
if (failure != null) {
failure.printStackTrace();
}
});