summaryrefslogtreecommitdiff
path: root/cpp/lib/broker/ExchangeRegistry.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/lib/broker/ExchangeRegistry.cpp')
-rw-r--r--cpp/lib/broker/ExchangeRegistry.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/cpp/lib/broker/ExchangeRegistry.cpp b/cpp/lib/broker/ExchangeRegistry.cpp
index 7bf96c4544..3e5ed89b54 100644
--- a/cpp/lib/broker/ExchangeRegistry.cpp
+++ b/cpp/lib/broker/ExchangeRegistry.cpp
@@ -59,7 +59,10 @@ void ExchangeRegistry::destroy(const string& name){
Exchange::shared_ptr ExchangeRegistry::get(const string& name){
Mutex::ScopedLock locker(lock);
- return exchanges[name];
+ Exchange::shared_ptr exchange =exchanges[name];
+ if (!exchange)
+ throw ChannelException(404, "Exchange not found:" + name);
+ return exchange;
}
namespace