From 36291970341057bbf5f818d5ee0c5e77ab14a308 Mon Sep 17 00:00:00 2001 From: Jesse Doyle Date: Wed, 13 Dec 2017 20:49:48 -0700 Subject: RedisCacheStore - Fix Default Error Handler * The `DEFAULT_ERROR_HANDLER` constant in `ActiveSupport::Cache::RedisCacheStore` contained references to an undefined argument `e`, which is supposed to refer to the `exception` parameter. * Update the default error handler proc to correctly reference the `exception` parameter. --- activesupport/lib/active_support/cache/redis_cache_store.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'activesupport/lib') diff --git a/activesupport/lib/active_support/cache/redis_cache_store.rb b/activesupport/lib/active_support/cache/redis_cache_store.rb index 3cf002f67e..6cc45f5284 100644 --- a/activesupport/lib/active_support/cache/redis_cache_store.rb +++ b/activesupport/lib/active_support/cache/redis_cache_store.rb @@ -47,9 +47,11 @@ module ActiveSupport reconnect_attempts: 0, } - DEFAULT_ERROR_HANDLER = -> (method:, returning:, exception:) { - logger.error { "RedisCacheStore: #{method} failed, returned #{returning.inspect}: #{e.class}: #{e.message}" } if logger - } + DEFAULT_ERROR_HANDLER = -> (method:, returning:, exception:) do + if logger + logger.error { "RedisCacheStore: #{method} failed, returned #{returning.inspect}: #{exception.class}: #{exception.message}" } + end + end DELETE_GLOB_LUA = "for i, name in ipairs(redis.call('KEYS', ARGV[1])) do redis.call('DEL', name); end" private_constant :DELETE_GLOB_LUA -- cgit v1.2.3