Log an error to the console when the memcache server is raising

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8687 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
上级 7701e646
......@@ -15,21 +15,24 @@ def initialize(*addresses)
def read(key, options = nil)
super
@data.get(key, raw?(options))
rescue MemCache::MemCacheError
rescue MemCache::MemCacheError => e
logger.error("MemCacheError (#{e}): #{e.message}")
nil
end
def write(key, value, options = nil)
super
@data.set(key, value, expires_in(options), raw?(options))
rescue MemCache::MemCacheError
rescue MemCache::MemCacheError => e
logger.error("MemCacheError (#{e}): #{e.message}")
nil
end
def delete(key, options = nil)
super
@data.delete(key, expires_in(options))
rescue MemCache::MemCacheError
rescue MemCache::MemCacheError => e
logger.error("MemCacheError (#{e}): #{e.message}")
nil
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册