summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/client
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2008-10-27 15:05:19 +0000
committerAlan Conway <aconway@apache.org>2008-10-27 15:05:19 +0000
commit56480c85567423e45a97a1f1c710e656ff0ed52e (patch)
tree9a037672c7be40ec4040224d4b992c8e547c3b85 /cpp/src/qpid/client
parent825327492ededcf62f7307a96eb29f5e7df88351 (diff)
downloadqpid-python-56480c85567423e45a97a1f1c710e656ff0ed52e.tar.gz
client::SubscriptionManager::findSubscription() throws if not found.
Added progress indicator to boost tests. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@708210 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/client')
-rw-r--r--cpp/src/qpid/client/SubscriptionManager.cpp6
-rw-r--r--cpp/src/qpid/client/SubscriptionManager.h4
2 files changed, 6 insertions, 4 deletions
diff --git a/cpp/src/qpid/client/SubscriptionManager.cpp b/cpp/src/qpid/client/SubscriptionManager.cpp
index 13cdd7cad1..350fd86aa6 100644
--- a/cpp/src/qpid/client/SubscriptionManager.cpp
+++ b/cpp/src/qpid/client/SubscriptionManager.cpp
@@ -110,8 +110,10 @@ bool SubscriptionManager::get(Message& result, const std::string& queue, sys::Du
Session SubscriptionManager::getSession() const { return session; }
Subscription SubscriptionManager::getSubscription(const std::string& name) const {
-
- return (*subscriptions.find(name)).second;
+ std::map<std::string, Subscription>::const_iterator i = subscriptions.find(name);
+ if (i == subscriptions.end())
+ throw Exception(QPID_MSG("Subscription not found: " << name));
+ return i->second;
}
void SubscriptionManager::registerFailoverHandler (boost::function<void ()> fh) {
diff --git a/cpp/src/qpid/client/SubscriptionManager.h b/cpp/src/qpid/client/SubscriptionManager.h
index 8b27a2c9b9..46394808f4 100644
--- a/cpp/src/qpid/client/SubscriptionManager.h
+++ b/cpp/src/qpid/client/SubscriptionManager.h
@@ -126,8 +126,8 @@ class SubscriptionManager : public sys::Runnable
*/
bool get(Message& result, const std::string& queue, sys::Duration timeout=0);
- /** Get a subscription by name, returns a null Subscription handle
- * if not found.
+ /** Get a subscription by name.
+ *@throw Exception if not found.
*/
Subscription getSubscription(const std::string& name) const;