From 08a3290ea65214e2af09d456dc0439082362782f Mon Sep 17 00:00:00 2001 From: Jean Boussier Date: Wed, 14 May 2025 12:54:24 +0200 Subject: [PATCH] Fix `without_reconnect` to wrap redis-client exceptions --- lib/redis/client.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/redis/client.rb b/lib/redis/client.rb index 16e7a23a..e564d7df 100644 --- a/lib/redis/client.rb +++ b/lib/redis/client.rb @@ -89,6 +89,12 @@ def password undef_method :call_once_v undef_method :blocking_call + def ensure_connected(retryable: true, &block) + super(retryable: retryable, &block) + rescue ::RedisClient::Error => error + Client.translate_error!(error) + end + def call_v(command, &block) super(command, &block) rescue ::RedisClient::Error => error