public static DataAccessException convertJedisAccessException(JedisException ex) {
if (ex instanceof JedisDataException) {
return new InvalidDataAccessApiUsageException(ex.getMessage(), ex);
}
if (ex instanceof JedisConnectionException) {
return new RedisConnectionFailureException(ex.getMessage(), ex);
}
// fallback to invalid data exception
return new InvalidDataAccessApiUsageException(ex.getMessage(), ex);
}