From bcf547057b604b30239c1afa122fad175b70be5b Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Mon, 18 Apr 2011 20:40:53 +0000 Subject: QPID-3208: Exchanges make best effort to route messages if there is an error. Previously if multiple queues were bound to the same routing key, then a failure to deliver to one of the queues (e.g. policy limit error) could prevent delivery on some of the other queues. With this commit the exchange delivers to every queue that did not have an error before raising an error. Note: this was originally committed as r1092765, but it caused test failures was reverted as r1092804. The original commit did not create exceptions of the correct type. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1094734 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/include/qpid/sys/ExceptionHolder.h | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'cpp/include') diff --git a/cpp/include/qpid/sys/ExceptionHolder.h b/cpp/include/qpid/sys/ExceptionHolder.h index 9eff1d64c7..4bc934cf75 100644 --- a/cpp/include/qpid/sys/ExceptionHolder.h +++ b/cpp/include/qpid/sys/ExceptionHolder.h @@ -10,9 +10,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -42,14 +42,11 @@ class ExceptionHolder : public Raisable { public: ExceptionHolder() {} // Use default copy & assign. - + /** Take ownership of ex */ template ExceptionHolder(Ex* ex) { wrap(ex); } - template ExceptionHolder(const boost::shared_ptr& ex) { wrap(ex.release()); } - template ExceptionHolder& operator=(Ex* ex) { wrap(ex); return *this; } - template ExceptionHolder& operator=(boost::shared_ptr ex) { wrap(ex.release()); return *this; } - + void raise() const { if (wrapper.get()) wrapper->raise() ; } std::string what() const { return wrapper.get() ? wrapper->what() : std::string(); } bool empty() const { return !wrapper.get(); } @@ -66,7 +63,7 @@ class ExceptionHolder : public Raisable { template void wrap(Ex* ex) { wrapper.reset(new Wrapper(ex)); } boost::shared_ptr wrapper; }; - + }} // namespace qpid::sys -- cgit v1.2.1