Skip to content

Commit

Permalink
Throw IllegalArgumentException at all such cases
Browse files Browse the repository at this point in the history
  • Loading branch information
sazzad16 committed Feb 15, 2024
1 parent 56d4d56 commit aa1012b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/main/java/redis/clients/jedis/util/JedisURIHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import redis.clients.jedis.HostAndPort;
import redis.clients.jedis.Protocol;
import redis.clients.jedis.RedisProtocol;
import redis.clients.jedis.exceptions.JedisValidationException;

public final class JedisURIHelper {

Expand Down Expand Up @@ -110,15 +109,15 @@ public static ClientSideCache getClientSideCache(URI uri) {
try {
maxSize = Integer.parseInt(val);
} catch (NumberFormatException nfe) {
throw new JedisValidationException("Value of cache_max_size must be an integer.", nfe);
throw new IllegalArgumentException("Value of cache_max_size must be an integer.", nfe);
}
break;

case "cache_ttl":
try {
ttl = Integer.parseInt(val);
} catch (NumberFormatException nfe) {
throw new JedisValidationException("Value of cache_ttl must be an integer denoting seconds.", nfe);
throw new IllegalArgumentException("Value of cache_ttl must be an integer denoting seconds.", nfe);
}
break;
}
Expand Down

0 comments on commit aa1012b

Please sign in to comment.