From 1434c1b7e36c3a6fed7cf9b7529a1a07542daa90 Mon Sep 17 00:00:00 2001 From: Martin Wittlinger Date: Mon, 10 Jul 2023 22:44:50 +0200 Subject: [PATCH] fix(vertx): Add error logging to exceptions in vertx --- .../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() {