diff options
author | Marnie McCormack <marnie@apache.org> | 2006-12-14 11:17:50 +0000 |
---|---|---|
committer | Marnie McCormack <marnie@apache.org> | 2006-12-14 11:17:50 +0000 |
commit | 1ed3df72cc4c1ab1bfe8e1e6125322329e15c396 (patch) | |
tree | 7c6c823b611b583dd3ded706717a2a992149d32d | |
parent | 8e367bd7aa3d0fc3517f093e117e53bbe7c1f83d (diff) | |
download | qpid-python-1ed3df72cc4c1ab1bfe8e1e6125322329e15c396.tar.gz |
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
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@487176 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | java/client/src/main/java/org/apache/qpid/client/AMQConnection.java | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/java/client/src/main/java/org/apache/qpid/client/AMQConnection.java b/java/client/src/main/java/org/apache/qpid/client/AMQConnection.java index 9dcbfca6bc..8b2387b9a0 100644 --- a/java/client/src/main/java/org/apache/qpid/client/AMQConnection.java +++ b/java/client/src/main/java/org/apache/qpid/client/AMQConnection.java @@ -879,7 +879,14 @@ public class AMQConnection extends Closeable implements Connection, QueueConnect } 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); |