This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/main by this push:
new a0d2a0dd448 CAMEL-21769: camel-core: ScheduledPollConsumer should not
swallow java.lang.Error but make a fatalog log and rethrow so the user has
visibility of the serious error in the logs.
a0d2a0dd448 is described below
commit a0d2a0dd44803e3a02308d958765ac4933fec8c7
Author: Claus Ibsen <[email protected]>
AuthorDate: Fri Feb 21 09:59:02 2025 +0100
CAMEL-21769: camel-core: ScheduledPollConsumer should not swallow
java.lang.Error but make a fatalog log and rethrow so the user has visibility
of the serious error in the logs.
---
.../main/java/org/apache/camel/support/ScheduledPollConsumer.java | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git
a/core/camel-support/src/main/java/org/apache/camel/support/ScheduledPollConsumer.java
b/core/camel-support/src/main/java/org/apache/camel/support/ScheduledPollConsumer.java
index c6f852bbec2..ae99f7392f8 100644
---
a/core/camel-support/src/main/java/org/apache/camel/support/ScheduledPollConsumer.java
+++
b/core/camel-support/src/main/java/org/apache/camel/support/ScheduledPollConsumer.java
@@ -130,9 +130,12 @@ public abstract class ScheduledPollConsumer extends
DefaultConsumer
} else {
LOG.trace("Scheduled task completed on: {}",
this.getEndpoint());
}
-
} catch (Error e) {
- // must catch Error, to ensure the task is re-scheduled
+ // need to log so there is visibility as otherwise the user may
not see anything in logs
+ LOG.error("Fatal error occurred during running scheduled task on:
{}, due: {}.",
+ this.getEndpoint(), e.getMessage(), e);
+ throw e;
+ } catch (Throwable e) {
LOG.error("Error occurred during running scheduled task on: {},
due: {}."
+ " This exception is ignored and the task will run
again on next poll.",
this.getEndpoint(), e.getMessage(), e);