diff options
| author | Martin Ritchie <ritchiem@apache.org> | 2009-04-15 10:56:26 +0000 |
|---|---|---|
| committer | Martin Ritchie <ritchiem@apache.org> | 2009-04-15 10:56:26 +0000 |
| commit | 6dd5a628ce4ae2e6c306d7e21fb45ceceee20cad (patch) | |
| tree | 39263f00e13dc6c81f2eedabfc7243aa00c47043 | |
| parent | 8c900d4b66a98b565fd1cfbc2036652cd12dfdca (diff) | |
| download | qpid-python-6dd5a628ce4ae2e6c306d7e21fb45ceceee20cad.tar.gz | |
QPID-1809 : When a DisconnectedException is recieved check the StateManager to see if there is a cause of the disconnection that we can throw instead to give more meaning.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@765132 13f79535-47bb-0310-9956-ffa450edef68
| -rw-r--r-- | java/client/src/main/java/org/apache/qpid/client/AMQConnection.java | 11 |
1 files changed, 11 insertions, 0 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 4db94627bc..39acee3a60 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 @@ -1310,6 +1310,17 @@ public class AMQConnection extends Closeable implements Connection, QueueConnect else { //Should never get here as all AMQEs are required to have an ErrorCode! + // Other than AMQDisconnectedEx! + + if (cause instanceof AMQDisconnectedException) + { + Exception last = _protocolHandler.getStateManager().getLastException(); + if (last != null) + { + _logger.info("StateManager had an exception for us to use a cause of our Disconnected Exception"); + cause = last; + } + } je = new JMSException("Exception thrown against " + toString() + ": " + cause); } |
