diff --git a/lib/redis/client.rb b/lib/redis/client.rb index 270eb11f4..d480020c6 100644 --- a/lib/redis/client.rb +++ b/lib/redis/client.rb @@ -119,8 +119,12 @@ def connect if username begin call [:auth, username, password] - rescue CommandError # Likely on Redis < 6 - call [:auth, password] + rescue CommandError => err # Likely on Redis < 6 + if err.message.match?(/ERR wrong number of arguments for \'auth\' command/) + call [:auth, password] + else + raise + end end else call [:auth, password]