DEV: Avoid logging errors on bad Redis connection during PG failover.

DEV: Avoid logging errors on bad Redis connection during PG failover.

diff --git a/config/initializers/002-rails_failover.rb b/config/initializers/002-rails_failover.rb
index 40809c1..0ec3857 100644
--- a/config/initializers/002-rails_failover.rb
+++ b/config/initializers/002-rails_failover.rb
@@ -55,7 +55,10 @@ if defined?(RailsFailover::ActiveRecord)
       Discourse::PG_FORCE_READONLY_MODE_KEY
     )
   rescue => e
-    Rails.logger.warn "#{e.class} #{e.message}: #{e.backtrace.join("\n")}"
+    unless e.is_a?(Redis::CannotConnectError)
+      Rails.logger.warn "#{e.class} #{e.message}: #{e.backtrace.join("\n")}"
+    end
+
     false
   end
 end

GitHub sha: 2c4c953b