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/96fc48c3 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/96fc48c3 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/96fc48c3 Branch: refs/heads/camel-2.17.x Commit: 96fc48c3ecce31843f1b47b9fef413a661349052 Parents: c05d776 Author: Claus Ibsen <[email protected]> Authored: Wed Apr 12 20:57:41 2017 +0200 Committer: Claus Ibsen <[email protected]> Committed: Wed Apr 12 20:59:55 2017 +0200 ---------------------------------------------------------------------- .../src/main/java/org/apache/camel/impl/ConsumerCache.java | 4 ++-- .../src/main/java/org/apache/camel/impl/ProducerCache.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/96fc48c3/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 52e227f..87244f0 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/96fc48c3/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 3a45e3e..00936c2 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 @@ -440,7 +440,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); }
