summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2008-02-11 13:00:45 +0000
committerGordon Sim <gsim@apache.org>2008-02-11 13:00:45 +0000
commit50c90fe9836fd4e7b32d7d6665c93659a91f02e3 (patch)
tree885790e3243dd6c3212f910c6af4b6be0760b33f /cpp
parent76bb9ff15b04a406153f7de71092eef0e27c0249 (diff)
downloadqpid-python-50c90fe9836fd4e7b32d7d6665c93659a91f02e3.tar.gz
Check valid listener (or handler) exist and log error if not. See QPID-783.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@620479 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp')
-rw-r--r--cpp/src/qpid/client/Dispatcher.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/cpp/src/qpid/client/Dispatcher.cpp b/cpp/src/qpid/client/Dispatcher.cpp
index 0783d5bc55..8df4637c88 100644
--- a/cpp/src/qpid/client/Dispatcher.cpp
+++ b/cpp/src/qpid/client/Dispatcher.cpp
@@ -75,11 +75,18 @@ void Dispatcher::run()
if (content->isA<MessageTransferBody>()) {
Message msg(*content, session);
Subscriber::shared_ptr listener = find(msg.getDestination());
- assert(listener);
- listener->received(msg);
+ if (!listener) {
+ QPID_LOG(error, "No listener found for destination " << msg.getDestination());
+ } else {
+ assert(listener);
+ listener->received(msg);
+ }
} else {
- assert (handler.get());
- handler->handle(*content);
+ if (handler.get()) {
+ handler->handle(*content);
+ } else {
+ QPID_LOG(error, "No handler found for " << *(content->getMethod()));
+ }
}
}
} catch (const ClosedException&) {