diff options
| author | Gordon Sim <gsim@apache.org> | 2008-02-11 13:00:45 +0000 |
|---|---|---|
| committer | Gordon Sim <gsim@apache.org> | 2008-02-11 13:00:45 +0000 |
| commit | 0751024a14f2053a5a0f886efe695a1a2da64c42 (patch) | |
| tree | bc9a1e9a1d728b6a62913d96cc4433c061e26c13 /qpid/cpp/src | |
| parent | 5f10d4097d84da6077409ef0ae8b20af10fc6d61 (diff) | |
| download | qpid-python-0751024a14f2053a5a0f886efe695a1a2da64c42.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@620479 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src')
| -rw-r--r-- | qpid/cpp/src/qpid/client/Dispatcher.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/qpid/cpp/src/qpid/client/Dispatcher.cpp b/qpid/cpp/src/qpid/client/Dispatcher.cpp index 0783d5bc55..8df4637c88 100644 --- a/qpid/cpp/src/qpid/client/Dispatcher.cpp +++ b/qpid/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&) { |
