Skip to content

Commit

Permalink
fix: make sure we catch all throwables
Browse files Browse the repository at this point in the history
Errors were not being caught in the executor, so they were silently
ignored. This commit fixes that.

Fixes MWTELE-262 (see also MWTELE-232)
  • Loading branch information
quintesse committed May 20, 2024
1 parent 4711027 commit 6501d60
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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;
}
};

Expand Down

0 comments on commit 6501d60

Please sign in to comment.