From 3b3f8434108f4246e04d1793e93a1e4fac305289 Mon Sep 17 00:00:00 2001 From: Martin Wittlinger Date: Mon, 10 Jul 2023 22:49:35 +0200 Subject: [PATCH] fix(vertx): Add error logging to exceptions in vertx (#819) --- .../laughing_train/mining/QodanaPeriodicMiner.java | 8 ++++++-- .../laughing_train/mining/SpoonPeriodicMiner.java | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/github-bot/src/main/java/io/github/martinwitt/laughing_train/mining/QodanaPeriodicMiner.java b/github-bot/src/main/java/io/github/martinwitt/laughing_train/mining/QodanaPeriodicMiner.java index 77b460f8c..a60be4caa 100644 --- a/github-bot/src/main/java/io/github/martinwitt/laughing_train/mining/QodanaPeriodicMiner.java +++ b/github-bot/src/main/java/io/github/martinwitt/laughing_train/mining/QodanaPeriodicMiner.java @@ -78,8 +78,12 @@ private Project getKnownProject() { } void mine(@Observes StartupEvent event) { - logger.atInfo().log("Starting Qodana periodic miner"); - vertx.setTimer(TimeUnit.MINUTES.toMillis(5), v -> vertx.executeBlocking(it -> mineRandomRepo())); + try { + logger.atInfo().log("Starting Qodana periodic miner"); + vertx.setTimer(TimeUnit.MINUTES.toMillis(5), v -> vertx.executeBlocking(it -> mineRandomRepo())); + } catch (Exception e) { + logger.atWarning().withCause(e).log("Failed to repo with Qodana"); + } } private void mineRandomRepo() { diff --git a/github-bot/src/main/java/io/github/martinwitt/laughing_train/mining/SpoonPeriodicMiner.java b/github-bot/src/main/java/io/github/martinwitt/laughing_train/mining/SpoonPeriodicMiner.java index 5da1db47e..20a7e2155 100644 --- a/github-bot/src/main/java/io/github/martinwitt/laughing_train/mining/SpoonPeriodicMiner.java +++ b/github-bot/src/main/java/io/github/martinwitt/laughing_train/mining/SpoonPeriodicMiner.java @@ -73,8 +73,12 @@ private Project getKnownProject() { } void mine(@Observes StartupEvent event) { - logger.atInfo().log("Start mining with spoon"); - vertx.setTimer(TimeUnit.MINUTES.toMillis(5), v -> vertx.executeBlocking(it -> mineRandomRepo())); + try { + logger.atInfo().log("Start mining with spoon"); + vertx.setTimer(TimeUnit.MINUTES.toMillis(5), v -> vertx.executeBlocking(it -> mineRandomRepo())); + } catch (Exception e) { + logger.atWarning().withCause(e).log("Failed to repo with spoon"); + } } private void mineRandomRepo() {