qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From g...@apache.org
Subject svn commit: r1538658 - in /qpid/trunk/qpid/cpp/src/qpid: broker/amqp/Session.cpp messaging/amqp/ConnectionContext.cpp
Date Mon, 04 Nov 2013 16:02:28 GMT
Author: gsim
Date: Mon Nov  4 16:02:28 2013
New Revision: 1538658

URL: http://svn.apache.org/r1538658
Log:
QPID-5289: Improvements to error handling and reporting

Modified:
    qpid/trunk/qpid/cpp/src/qpid/broker/amqp/Session.cpp
    qpid/trunk/qpid/cpp/src/qpid/messaging/amqp/ConnectionContext.cpp

Modified: qpid/trunk/qpid/cpp/src/qpid/broker/amqp/Session.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/amqp/Session.cpp?rev=1538658&r1=1538657&r2=1538658&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/broker/amqp/Session.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/broker/amqp/Session.cpp Mon Nov  4 16:02:28 2013
@@ -652,7 +652,11 @@ void IncomingToQueue::handle(qpid::broke
         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)

Modified: qpid/trunk/qpid/cpp/src/qpid/messaging/amqp/ConnectionContext.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/messaging/amqp/ConnectionContext.cpp?rev=1538658&r1=1538657&r2=1538658&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/messaging/amqp/ConnectionContext.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/messaging/amqp/ConnectionContext.cpp Mon Nov  4 16:02:28
2013
@@ -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());
     }
 }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message