diff --git a/lib/redis/client.rb b/lib/redis/client.rb index 9656a0f4d..d8a2ceca5 100644 --- a/lib/redis/client.rb +++ b/lib/redis/client.rb @@ -590,6 +590,10 @@ def sentinel_detect return result end rescue BaseConnectionError + rescue RuntimeError => exception + # Needed because when the sentinel address cannot be resolved it + # raises this instead of "BaseConnectionError" + raise unless exception.message =~ /Name or service not known/ ensure client.disconnect end