summaryrefslogtreecommitdiff
path: root/cpp/include
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2011-04-18 20:40:53 +0000
committerAlan Conway <aconway@apache.org>2011-04-18 20:40:53 +0000
commitbcf547057b604b30239c1afa122fad175b70be5b (patch)
tree1fe781be693d970c3b0efa2b21c37882345b4710 /cpp/include
parent0960e28486aaf55c6fd960bf9ea165d99ebeb11c (diff)
downloadqpid-python-bcf547057b604b30239c1afa122fad175b70be5b.tar.gz
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
Diffstat (limited to 'cpp/include')
-rw-r--r--cpp/include/qpid/sys/ExceptionHolder.h13
1 files changed, 5 insertions, 8 deletions
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 <class Ex> ExceptionHolder(Ex* ex) { wrap(ex); }
- template <class Ex> ExceptionHolder(const boost::shared_ptr<Ex>& ex) { wrap(ex.release()); }
-
template <class Ex> ExceptionHolder& operator=(Ex* ex) { wrap(ex); return *this; }
- template <class Ex> ExceptionHolder& operator=(boost::shared_ptr<Ex> 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 <class Ex> void wrap(Ex* ex) { wrapper.reset(new Wrapper<Ex>(ex)); }
boost::shared_ptr<Raisable> wrapper;
};
-
+
}} // namespace qpid::sys