diff options
Diffstat (limited to 'qpid/cpp/src')
| -rw-r--r-- | qpid/cpp/src/qpid/broker/amqp/Session.cpp | 6 | ||||
| -rw-r--r-- | qpid/cpp/src/qpid/messaging/amqp/ConnectionContext.cpp | 9 |
2 files changed, 13 insertions, 2 deletions
diff --git a/qpid/cpp/src/qpid/broker/amqp/Session.cpp b/qpid/cpp/src/qpid/broker/amqp/Session.cpp index 25bba04fbd..8ad95e8075 100644 --- a/qpid/cpp/src/qpid/broker/amqp/Session.cpp +++ b/qpid/cpp/src/qpid/broker/amqp/Session.cpp @@ -652,7 +652,11 @@ void IncomingToQueue::handle(qpid::broker::Message& message) msg << " Queue " << queue->getName() << " has been deleted"; throw Exception(qpid::amqp::error_conditions::RESOURCE_DELETED, msg.str()); } - queue->deliver(message); + try { + queue->deliver(message); + } catch (const qpid::SessionException& e) { + throw Exception(qpid::amqp::error_conditions::PRECONDITION_FAILED, e.what()); + } } void IncomingToExchange::handle(qpid::broker::Message& message) diff --git a/qpid/cpp/src/qpid/messaging/amqp/ConnectionContext.cpp b/qpid/cpp/src/qpid/messaging/amqp/ConnectionContext.cpp index 5217bca7e7..f65f8e5eb0 100644 --- a/qpid/cpp/src/qpid/messaging/amqp/ConnectionContext.cpp +++ b/qpid/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()); } } |
