summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/messaging/amqp/ConnectionContext.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/qpid/messaging/amqp/ConnectionContext.cpp')
-rw-r--r--cpp/src/qpid/messaging/amqp/ConnectionContext.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/cpp/src/qpid/messaging/amqp/ConnectionContext.cpp b/cpp/src/qpid/messaging/amqp/ConnectionContext.cpp
index 5217bca7e7..f65f8e5eb0 100644
--- a/cpp/src/qpid/messaging/amqp/ConnectionContext.cpp
+++ b/cpp/src/qpid/messaging/amqp/ConnectionContext.cpp
@@ -412,8 +412,15 @@ void ConnectionContext::check()
}
}
if ((pn_connection_state(connection) & REQUIRES_CLOSE) == REQUIRES_CLOSE) {
+ pn_condition_t* error = pn_connection_remote_condition(connection);
+ std::stringstream text;
+ if (pn_condition_is_set(error)) {
+ text << "Connection closed by peer with " << pn_condition_get_name(error) << ": " << pn_condition_get_description(error);
+ } else {
+ text << "Connection closed by peer";
+ }
pn_connection_close(connection);
- throw qpid::messaging::ConnectionError("Connection closed by peer");
+ throw qpid::messaging::ConnectionError(text.str());
}
}