You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ta...@apache.org on 2009/03/02 15:07:56 UTC

svn commit: r749311 - /activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Connection.cs

Author: tabish
Date: Mon Mar  2 14:07:55 2009
New Revision: 749311

URL: http://svn.apache.org/viewvc?rev=749311&view=rev
Log:
https://issues.apache.org/activemq/browse/AMQNET-149

Applied Jim's patch to add handling of ConnectionError to the Connection class.

Modified:
    activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Connection.cs

Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Connection.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Connection.cs?rev=749311&r1=749310&r2=749311&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Connection.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Connection.cs Mon Mar  2 14:07:55 2009
@@ -434,12 +434,32 @@
 			}
 			else if(command is ShutdownInfo)
 			{
-				//ShutdownInfo info = (ShutdownInfo)command;
 				if(!closing && !closed)
 				{
 					OnException(commandTransport, new NMSException("Broker closed this connection."));
 				}
 			}
+			else if(command is ConnectionError)
+			{
+			    if(!closing && !closed)
+			    {
+			        ConnectionError connectionError = (ConnectionError) command;
+			        BrokerError brokerError = connectionError.Exception;
+			        string message = "Broker connection error.";
+			        string cause = "";
+
+			        if(null != brokerError)
+			        {
+			            message = brokerError.Message;
+			            if(null != brokerError.Cause)
+			            {
+			                cause = brokerError.Cause.Message;
+			            }
+			        }
+
+			        OnException(commandTransport, new NMSConnectionException(message, cause));
+			    }
+			}
 			else
 			{
 				Tracer.Error("Unknown command: " + command);