failover = false;
}
}
if (failover)
{
return new MessagingNetworkFailureException(cc);
}
}
else if ((t instanceof IOException) || (t instanceof ConnectionFailedException))
{
return new MessagingNetworkFailureException((Exception)t);
}
//This can occur if failure happens when Client.connect() is called
//Ideally remoting should have a consistent API
else if (t instanceof RuntimeException)
{
RuntimeException re = (RuntimeException)t;
Throwable initCause = re.getCause();
if (initCause != null)
{
do
{
if ((initCause instanceof CannotConnectException) ||
(initCause instanceof IOException) ||
(initCause instanceof ConnectionFailedException))
{
return new MessagingNetworkFailureException((Exception)initCause);
}
initCause = initCause.getCause();
}
while (initCause != null);
}