You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2017/04/12 19:01:04 UTC

[2/6] camel git commit: CAMEL-11139: Catch throwable in other places and also in the consumer cache

CAMEL-11139: Catch throwable in other places and also in the consumer cache


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/67ab9a97
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/67ab9a97
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/67ab9a97

Branch: refs/heads/master
Commit: 67ab9a97250909e7ba7a3081d9f506ad22702248
Parents: d6cdc99
Author: Claus Ibsen <da...@apache.org>
Authored: Wed Apr 12 20:57:41 2017 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Wed Apr 12 20:57:41 2017 +0200

----------------------------------------------------------------------
 .../src/main/java/org/apache/camel/impl/ConsumerCache.java       | 4 ++--
 .../src/main/java/org/apache/camel/impl/ProducerCache.java       | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/67ab9a97/camel-core/src/main/java/org/apache/camel/impl/ConsumerCache.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/impl/ConsumerCache.java b/camel-core/src/main/java/org/apache/camel/impl/ConsumerCache.java
index 20deb90..4cb8ef4 100644
--- a/camel-core/src/main/java/org/apache/camel/impl/ConsumerCache.java
+++ b/camel-core/src/main/java/org/apache/camel/impl/ConsumerCache.java
@@ -145,7 +145,7 @@ public class ConsumerCache extends ServiceSupport {
                         LOG.debug("Released PollingConsumer: {} is stopped as consumer cache is full", endpoint);
                     }
                     ServiceHelper.stopAndShutdownService(pollingConsumer);
-                } catch (Exception ex) {
+                } catch (Throwable ex) {
                     if (ex instanceof RuntimeCamelException) {
                         throw (RuntimeCamelException)ex;
                     } else {
@@ -171,7 +171,7 @@ public class ConsumerCache extends ServiceSupport {
             try {
                 answer = endpoint.createPollingConsumer();
                 answer.start();
-            } catch (Exception e) {
+            } catch (Throwable e) {
                 throw new FailedToCreateConsumerException(endpoint, e);
             }
             if (pooled && answer instanceof ServicePoolAware) {

http://git-wip-us.apache.org/repos/asf/camel/blob/67ab9a97/camel-core/src/main/java/org/apache/camel/impl/ProducerCache.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/impl/ProducerCache.java b/camel-core/src/main/java/org/apache/camel/impl/ProducerCache.java
index bfd20f0..faa0f72 100644
--- a/camel-core/src/main/java/org/apache/camel/impl/ProducerCache.java
+++ b/camel-core/src/main/java/org/apache/camel/impl/ProducerCache.java
@@ -320,7 +320,7 @@ public class ProducerCache extends ServiceSupport {
                             doneSync -> asyncDispatchExchange(endpoint, producer, resultProcessor,
                                     finalExchange, producerCallback));
                         return false;
-                    } catch (Exception e) {
+                    } catch (Throwable e) {
                         // populate failed so return
                         innerExchange.setException(e);
                         producerCallback.done(true);
@@ -575,7 +575,7 @@ public class ProducerCache extends ServiceSupport {
                 // add as service which will also start the service
                 // (false => we and handling the lifecycle of the producer in this cache)
                 getCamelContext().addService(answer, false);
-            } catch (Exception e) {
+            } catch (Throwable e) {
                 throw new FailedToCreateProducerException(endpoint, e);
             }