diff options
| author | Gordon Sim <gsim@apache.org> | 2013-11-04 16:02:28 +0000 |
|---|---|---|
| committer | Gordon Sim <gsim@apache.org> | 2013-11-04 16:02:28 +0000 |
| commit | 35ef6db29a23cb3e6c3061ea325d0b5d660508e3 (patch) | |
| tree | 171ea5c38789811648030e29f99bbc3c7526f9c5 /cpp/src/qpid/messaging | |
| parent | 0baf985f809992e6ccedbe18fe6275f73fe44388 (diff) | |
| download | qpid-python-35ef6db29a23cb3e6c3061ea325d0b5d660508e3.tar.gz | |
QPID-5289: Improvements to error handling and reporting
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1538658 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/messaging')
| -rw-r--r-- | cpp/src/qpid/messaging/amqp/ConnectionContext.cpp | 9 |
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()); } } |
