Skip to content

Commit

Permalink
Merge pull request #1 from 3scale/sentinels-addr-resolve-err
Browse files Browse the repository at this point in the history
Fix error raised when trying to connect to a sentinel addr that cannot be resolved
  • Loading branch information
unleashed authored Apr 22, 2020
2 parents a2c562c + b1e258e commit 03759b1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/redis/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 03759b1

Please sign in to comment.