diff options
Diffstat (limited to 'cpp/src/qpid/client/ConnectionHandler.cpp')
-rw-r--r-- | cpp/src/qpid/client/ConnectionHandler.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/cpp/src/qpid/client/ConnectionHandler.cpp b/cpp/src/qpid/client/ConnectionHandler.cpp index ada3fa4fb0..f20f597d1f 100644 --- a/cpp/src/qpid/client/ConnectionHandler.cpp +++ b/cpp/src/qpid/client/ConnectionHandler.cpp @@ -175,8 +175,9 @@ void ConnectionHandler::handle(AMQMethodBody::shared_ptr method) if (method->isA<ConnectionCloseBody>()) { send(make_shared_ptr(new ConnectionCloseOkBody(version))); setState(CLOSED); - if (onClose) { - onClose(); + if (onError) { + ConnectionCloseBody::shared_ptr c(shared_polymorphic_cast<ConnectionCloseBody>(method)); + onError(c->getReplyCode(), c->getReplyText()); } } else { error(503, "Unexpected method on channel zero.", method->amqpClassId(), method->amqpMethodId()); |