added better exception

git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@385792 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
James Strachan 2006-03-14 11:57:59 +00:00
parent 99e340a5e8
commit daf48bb297
1 changed files with 6 additions and 3 deletions

View File

@ -143,8 +143,8 @@ public class ActiveMQConnection extends DefaultTransportListener implements Conn
private AdvisoryConsumer advisoryConsumer;
private final CountDownLatch brokerInfoReceived = new CountDownLatch(1);
private BrokerInfo brokerInfo;
private IOException firstFailureError;
@ -1150,7 +1150,7 @@ public class ActiveMQConnection extends DefaultTransportListener implements Conn
protected synchronized void checkClosedOrFailed() throws JMSException {
checkClosed();
if (transportFailed.get()){
throw new ConnectionFailedException();
throw new ConnectionFailedException(firstFailureError);
}
}
@ -1644,8 +1644,11 @@ public class ActiveMQConnection extends DefaultTransportListener implements Conn
}
}
protected void transportFailed(Throwable error){
protected void transportFailed(IOException error){
transportFailed.set(true);
if (firstFailureError == null) {
firstFailureError = error;
}
if (!closed.get() && !closing.get()) {
try{
cleanup();