Permalink
Browse files

Make sure MemCacheStore logger exists

  • Loading branch information...
1 parent d18ff1b commit eed89e65b6320a59115da0c5ef004c727e0f9cbf @josh josh committed Apr 7, 2010
Showing with 3 additions and 3 deletions.
  1. +3 −3 activesupport/lib/active_support/cache/mem_cache_store.rb
@@ -64,7 +64,7 @@ def read(key, options = nil) # :nodoc:
@data.get(key, raw?(options))
end
rescue MemCache::MemCacheError => e
- logger.error("MemCacheError (#{e}): #{e.message}")
+ logger.error("MemCacheError (#{e}): #{e.message}") if logger
nil
end
@@ -85,7 +85,7 @@ def write(key, value, options = nil)
response == Response::STORED
end
rescue MemCache::MemCacheError => e
- logger.error("MemCacheError (#{e}): #{e.message}")
+ logger.error("MemCacheError (#{e}): #{e.message}") if logger
false
end
@@ -95,7 +95,7 @@ def delete(key, options = nil) # :nodoc:
response == Response::DELETED
end
rescue MemCache::MemCacheError => e
- logger.error("MemCacheError (#{e}): #{e.message}")
+ logger.error("MemCacheError (#{e}): #{e.message}") if logger
false
end

0 comments on commit eed89e6

Please sign in to comment.