catch (NumberFormatException nfe)
{
// Ignore this, we have some error codes and messages swapped around
}
throw new AMQConnectionFailureException(AMQConstant.getConstant(code),
e.getMessage(), e);
}
else if (lastException != null)
{
if (lastException.getCause() != null)
{
message = lastException.getCause().getMessage();
}
else
{
message = lastException.getMessage();
}
}
if ((message == null) || message.equals(""))
{
if (message == null)
{
message = "Unable to Connect";
}
else // can only be "" if getMessage() returned it therfore lastException != null
{
message = "Unable to Connect:" + lastException.getClass();
}
}
AMQException e = new AMQConnectionFailureException(message);
if (lastException != null)
{
if (lastException instanceof UnresolvedAddressException)
{
e = new AMQUnresolvedAddressException(message, _failoverPolicy.getCurrentBrokerDetails().toString());
}
e.initCause(lastException);
}
throw e;
}