Author: marnie
Date: Thu Dec 14 03:17:50 2006
New Revision: 487176

URL: http://svn.apache.org/viewvc?view=rev&rev=487176
Log:
Added error code to the construction JMS exception passed back to the exception 
listener in exceptionReceived method, where exception subclasses AMQException 
and thus exposes an error code. See JIRA-186

Modified:
    
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnection.java

Modified: 
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnection.java
URL: 
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnection.java?view=diff&rev=487176&r1=487175&r2=487176
==============================================================================
--- 
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnection.java
 (original)
+++ 
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnection.java
 Thu Dec 14 03:17:50 2006
@@ -879,7 +879,14 @@
         }
         else
         {
-            je = new JMSException("Exception thrown against " + toString() + 
": " + cause);
+            if (cause instanceof AMQException)
+            {
+                je = new 
JMSException(Integer.toString(((AMQException)cause).getErrorCode()) ,"Exception 
thrown against " + toString() + ": " + cause);
+            }
+            else
+            {
+                je = new JMSException("Exception thrown against " + toString() 
+ ": " + cause);
+            }
             if (cause instanceof Exception)
             {
                 je.setLinkedException((Exception) cause);


Reply via email to