qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From g...@apache.org
Subject svn commit: r1152853 - in /qpid/trunk/qpid/cpp/src/qpid/client: ConnectionHandler.cpp ConnectionImpl.cpp SslConnector.cpp amqp0_10/ConnectionImpl.cpp
Date Mon, 01 Aug 2011 16:06:31 GMT
Author: gsim
Date: Mon Aug  1 16:06:30 2011
New Revision: 1152853

URL: http://svn.apache.org/viewvc?rev=1152853&view=rev
Log:
QPID-3382: Corrected some exception types for connect errors

Modified:
    qpid/trunk/qpid/cpp/src/qpid/client/ConnectionHandler.cpp
    qpid/trunk/qpid/cpp/src/qpid/client/ConnectionImpl.cpp
    qpid/trunk/qpid/cpp/src/qpid/client/SslConnector.cpp
    qpid/trunk/qpid/cpp/src/qpid/client/amqp0_10/ConnectionImpl.cpp

Modified: qpid/trunk/qpid/cpp/src/qpid/client/ConnectionHandler.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/client/ConnectionHandler.cpp?rev=1152853&r1=1152852&r2=1152853&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/client/ConnectionHandler.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/client/ConnectionHandler.cpp Mon Aug  1 16:06:30 2011
@@ -143,7 +143,9 @@ void ConnectionHandler::outgoing(AMQFram
 void ConnectionHandler::waitForOpen()
 {
     waitFor(ESTABLISHED);
-    if (getState() == FAILED || getState() == CLOSED) {
+    if (getState() == FAILED) {
+        throw TransportFailure(errorText);
+    } else if (getState() == CLOSED) {
         throw ConnectionException(errorCode, errorText);
     }
 }

Modified: qpid/trunk/qpid/cpp/src/qpid/client/ConnectionImpl.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/client/ConnectionImpl.cpp?rev=1152853&r1=1152852&r2=1152853&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/client/ConnectionImpl.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/client/ConnectionImpl.cpp Mon Aug  1 16:06:30 2011
@@ -265,7 +265,7 @@ void ConnectionImpl::open()
     } catch (const std::exception& e) {
         QPID_LOG(debug, "Failed to connect to " << protocol << ":" << host
<< ":" << port << " " << e.what());
         connector.reset();
-        throw;
+        throw TransportFailure(e.what());
     }
     connector->init();
 

Modified: qpid/trunk/qpid/cpp/src/qpid/client/SslConnector.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/client/SslConnector.cpp?rev=1152853&r1=1152852&r2=1152853&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/client/SslConnector.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/client/SslConnector.cpp Mon Aug  1 16:06:30 2011
@@ -197,7 +197,7 @@ void SslConnector::connect(const std::st
         socket.connect(host, port);
     } catch (const std::exception& e) {
         socket.close();
-        throw ConnectionException(framing::connection::CLOSE_CODE_FRAMING_ERROR, e.what());
+        throw TransportFailure(e.what());
     }
 
     identifier = str(format("[%1% %2%]") % socket.getLocalPort() % socket.getPeerAddress());

Modified: qpid/trunk/qpid/cpp/src/qpid/client/amqp0_10/ConnectionImpl.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/client/amqp0_10/ConnectionImpl.cpp?rev=1152853&r1=1152852&r2=1152853&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/client/amqp0_10/ConnectionImpl.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/client/amqp0_10/ConnectionImpl.cpp Mon Aug  1 16:06:30 2011
@@ -284,10 +284,7 @@ bool ConnectionImpl::tryConnect()
             QPID_LOG(info, "Connected to " << *i);
             mergeUrls(connection.getInitialBrokers(), l);
             return resetSessions(l);
-        } catch (const qpid::ConnectionException& e) {
-            //TODO: need to fix timeout on
-            //qpid::client::Connection::open() so that it throws
-            //TransportFailure rather than a ConnectionException
+        } catch (const qpid::TransportFailure& e) {
             QPID_LOG(info, "Failed to connect to " << *i << ": " << e.what());
         }
     }



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org


Mime
View raw message