Module: SolidCache::Store::Failsafe

Included in:
SolidCache::Store
Defined in:
lib/solid_cache/store/failsafe.rb

Constant Summary collapse

DEFAULT_ERROR_HANDLER =
->(method:, returning:, exception:) do
  if Store.logger
    Store.logger.error { "SolidCacheStore: #{method} failed, returned #{returning.inspect}: #{exception.class}: #{exception.message}" }
  end
end

Instance Method Summary collapse

Instance Method Details

#initialize(options = {}) ⇒ Object



10
11
12
13
14
# File 'lib/solid_cache/store/failsafe.rb', line 10

def initialize(options = {})
  super(options)

  @error_handler = options.fetch(:error_handler, DEFAULT_ERROR_HANDLER)
end