From ee9edac25c40f90b352e30ad09d1ef8077cf9285 Mon Sep 17 00:00:00 2001 From: Lea Roy Klinginsmith Date: Tue, 28 Nov 2023 15:37:49 -0700 Subject: [PATCH] Add NodeMightBeDown to redis client error mapping --- cluster/lib/redis/cluster.rb | 3 +++ cluster/lib/redis/cluster/client.rb | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/cluster/lib/redis/cluster.rb b/cluster/lib/redis/cluster.rb index d7a06f6b..58c775f5 100644 --- a/cluster/lib/redis/cluster.rb +++ b/cluster/lib/redis/cluster.rb @@ -41,6 +41,9 @@ class AmbiguousNodeError < BaseError class TransactionConsistencyError < BaseError end + class NodeMightBeDown < BaseError + end + def connection raise NotImplementedError, "Redis::Cluster doesn't implement #connection" end diff --git a/cluster/lib/redis/cluster/client.rb b/cluster/lib/redis/cluster/client.rb index 70367c1f..06e4a526 100644 --- a/cluster/lib/redis/cluster/client.rb +++ b/cluster/lib/redis/cluster/client.rb @@ -10,7 +10,8 @@ class Client < RedisClient::Cluster RedisClient::Cluster::OrchestrationCommandNotSupported => Redis::Cluster::OrchestrationCommandNotSupported, RedisClient::Cluster::AmbiguousNodeError => Redis::Cluster::AmbiguousNodeError, RedisClient::Cluster::ErrorCollection => Redis::Cluster::CommandErrorCollection, - RedisClient::Cluster::Transaction::ConsistencyError => Redis::Cluster::TransactionConsistencyError + RedisClient::Cluster::Transaction::ConsistencyError => Redis::Cluster::TransactionConsistencyError, + RedisClient::Cluster::NodeMightBeDown => Redis::Cluster::NodeMightBeDown, ).freeze class << self