From 0d8be5f2853c88cbcb8d908e3dac9def7a78bc98 Mon Sep 17 00:00:00 2001 From: David Ortiz Date: Mon, 17 Feb 2020 17:38:01 +0100 Subject: [PATCH] extensions/redis: handle "name not known" --- lib/3scale/backend/extensions/redis.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/3scale/backend/extensions/redis.rb b/lib/3scale/backend/extensions/redis.rb index d45b2789e..d56c45bbe 100644 --- a/lib/3scale/backend/extensions/redis.rb +++ b/lib/3scale/backend/extensions/redis.rb @@ -27,6 +27,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