if (th instanceof LoginFault) {
throw new InvalidLoginException(getExceptionMessage(th), getExceptionCode(th), connection, th);
} else if (isInsufficientPermissionsException(th)) {
throwNewInsufficientPermissionsException(connection, th);
} else if (th instanceof ApiFault) {
throw new ForceConnectionException(getExceptionMessage(th), getExceptionCode(th), connection, th);
} else if (th.getCause() != null && connection.getConnectorConfig() != null) {
String msg = getConnectionCauseExceptionMessage(connection.getConnectorConfig(), th);
throw new ForceConnectionException(msg, connection, th);
} else {
throw new ForceConnectionException(getStrippedRootCauseMessage(th), connection, th);
}
}