summaryrefslogtreecommitdiff
path: root/qpid/java
diff options
context:
space:
mode:
authorMarnie McCormack <marnie@apache.org>2006-12-14 11:17:50 +0000
committerMarnie McCormack <marnie@apache.org>2006-12-14 11:17:50 +0000
commitbec491b1b48df8846c900006dad651a744864bac (patch)
tree60a8fc4184f6bc2d7ee4736b15c091ff56540360 /qpid/java
parent347dae32c31219bdcf70932be0005364d736c774 (diff)
downloadqpid-python-bec491b1b48df8846c900006dad651a744864bac.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@487176 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java')
-rw-r--r--qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnection.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnection.java b/qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnection.java
index 9dcbfca6bc..8b2387b9a0 100644
--- a/qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnection.java
+++ b/qpid/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);