Skip to content

Commit 8f45f4d

Browse files
authored
Use IllegalArgumentException
1 parent 6652ee4 commit 8f45f4d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/main/java/redis/clients/jedis/util/SafeEncoder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public static byte[][] encodeMany(final String... strs) {
2626
public static byte[] encode(final String str) {
2727
try {
2828
if (str == null) {
29-
throw new JedisException("null value cannot be sent to redis");
29+
throw new IllegalArgumentException("null value cannot be sent to redis");
3030
}
3131
return str.getBytes(Protocol.CHARSET);
3232
} catch (UnsupportedEncodingException e) {

src/test/java/redis/clients/jedis/tests/JedisTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ public void infiniteTimeout() throws Exception {
113113
jedis.close();
114114
}
115115

116-
@Test(expected = JedisException.class)
116+
@Test(expected = IllegalArgumentException.class)
117117
public void failWhenSendingNullValues() {
118118
jedis.set("foo", null);
119119
}

0 commit comments

Comments
 (0)