Assert.notNull(ex, "Exception must not be null");
if (ex instanceof AmqpException) {
return (AmqpException) ex;
}
if (ex instanceof ShutdownSignalException) {
return new AmqpConnectException((ShutdownSignalException) ex);
}
if (ex instanceof ConnectException) {
return new AmqpConnectException((ConnectException) ex);
}
if (ex instanceof PossibleAuthenticationFailureException) {
return new AmqpAuthenticationException(ex);
}
if (ex instanceof UnsupportedEncodingException) {