From 6501d60b28d316ae441a0f5e823b9e6ae25f6678 Mon Sep 17 00:00:00 2001 From: Tako Schotanus Date: Mon, 20 May 2024 16:07:14 +0200 Subject: [PATCH] fix: make sure we catch all throwables Errors were not being caught in the executor, so they were silently ignored. This commit fixes that. Fixes MWTELE-262 (see also MWTELE-232) --- .../insights/InsightsCustomScheduledExecutor.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/api/src/main/java/com/redhat/insights/InsightsCustomScheduledExecutor.java b/api/src/main/java/com/redhat/insights/InsightsCustomScheduledExecutor.java index 0fa7f6e..b583088 100644 --- a/api/src/main/java/com/redhat/insights/InsightsCustomScheduledExecutor.java +++ b/api/src/main/java/com/redhat/insights/InsightsCustomScheduledExecutor.java @@ -1,4 +1,4 @@ -/* Copyright (C) Red Hat 2023 */ +/* Copyright (C) Red Hat 2023-2024 */ package com.redhat.insights; import static com.redhat.insights.InsightsErrorCode.ERROR_SCHEDULED_SENT; @@ -62,14 +62,14 @@ public ScheduledFuture scheduleAtFixedRate( ix); shutdown(); throw ix; - } catch (Exception x) { + } catch (Throwable th) { logger.error( ERROR_SCHEDULED_SENT.formatMessage( "Red Hat Insights client scheduler shutdown, non-Insights failure: " - + x.getMessage()), - x); + + th.getMessage()), + th); shutdown(); - throw x; + throw th; } };