You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by or...@apache.org on 2024/01/12 14:46:33 UTC
(camel) 05/06: CAMEL-20297 camel-splunk: do not swallow interrupted exceptions
This is an automated email from the ASF dual-hosted git repository.
orpiske pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
commit 39680a3f6c0c04f0579d3b2c88295e6652f56055
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Fri Jan 12 10:49:37 2024 +0100
CAMEL-20297 camel-splunk: do not swallow interrupted exceptions
---
.../org/apache/camel/component/splunk/SplunkConnectionFactory.java | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/components/camel-splunk/src/main/java/org/apache/camel/component/splunk/SplunkConnectionFactory.java b/components/camel-splunk/src/main/java/org/apache/camel/component/splunk/SplunkConnectionFactory.java
index faeccc89eac..dcd7ca630bf 100644
--- a/components/camel-splunk/src/main/java/org/apache/camel/component/splunk/SplunkConnectionFactory.java
+++ b/components/camel-splunk/src/main/java/org/apache/camel/component/splunk/SplunkConnectionFactory.java
@@ -168,6 +168,10 @@ public class SplunkConnectionFactory {
}
LOG.info("Successfully connected to Splunk");
return service;
+ } catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
+ throw new RuntimeException(
+ String.format("could not connect to Splunk Server @ %s:%d - %s", host, port, e.getMessage()), e);
} catch (Exception e) {
throw new RuntimeException(
String.format("could not connect to Splunk Server @ %s:%d - %s", host, port, e.getMessage()), e);