summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2007-03-20 17:35:28 +0000
committerGordon Sim <gsim@apache.org>2007-03-20 17:35:28 +0000
commitc3b33ead3e0028b44020bdb02cd139c8a85f409e (patch)
tree70e9b1196ee8b05b21a0993c3184d25b4eba6757
parent5542860e2dea4bd76f68793b92e095c4a266f227 (diff)
downloadqpid-python-c3b33ead3e0028b44020bdb02cd139c8a85f409e.tar.gz
Catch exception now thrown by ExchangeRegistry::getDefault() when a default has not been set.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/branches/qpid.0-9@520493 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--cpp/lib/broker/RecoveryManager.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/cpp/lib/broker/RecoveryManager.cpp b/cpp/lib/broker/RecoveryManager.cpp
index 6ea4c00c65..6548e6a24f 100644
--- a/cpp/lib/broker/RecoveryManager.cpp
+++ b/cpp/lib/broker/RecoveryManager.cpp
@@ -29,9 +29,13 @@ RecoveryManager::~RecoveryManager() {}
Queue::shared_ptr RecoveryManager::recoverQueue(const string& name)
{
std::pair<Queue::shared_ptr, bool> result = queues.declare(name, true);
- Exchange::shared_ptr exchange = exchanges.getDefault();
- if (exchange) {
- exchange->bind(result.first, result.first->getName(), 0);
+ try {
+ Exchange::shared_ptr exchange = exchanges.getDefault();
+ if (exchange) {
+ exchange->bind(result.first, result.first->getName(), 0);
+ }
+ } catch (ChannelException& e) {
+ //assume no default exchange has been declared
}
return result.first;
}