Skip to content

Commit 4daa722

Browse files
committed
Merge branch 'master' into 5.0
2 parents 4293747 + 65d47fc commit 4daa722

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/main/java/redis/clients/jedis/Connection.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,14 @@ private void initializeFromClientConfig(JedisClientConfig config) {
429429
if (obj instanceof JedisDataException) {
430430
JedisDataException e = (JedisDataException)obj;
431431
String errorMsg = e.getMessage().toUpperCase();
432-
if (errorMsg.contains("UNKNOWN") ||
432+
/**
433+
* 1. Redis 4.0 and before, we need to ignore `Syntax error`.
434+
* 2. Redis 5.0 and later, we need to ignore `Unknown subcommand error`.
435+
* 3. Because Jedis allows Jedis jedis = new Jedis() in advance, and jedis.auth(password) later,
436+
* we need to ignore `NOAUTH errors`.
437+
*/
438+
if (errorMsg.contains("SYNTAX") ||
439+
errorMsg.contains("UNKNOWN") ||
433440
errorMsg.contains("NOAUTH")) { // TODO: not filter out NOAUTH
434441
// ignore
435442
} else {

0 commit comments

Comments
 (0)