Skip to content

#read_entry in ActiveSupport::Cache::FileStore should log details of the exception when an exception is thrown #5125

Merged
merged 1 commit into from May 22, 2012

3 participants

@winston
winston commented Feb 22, 2012

Currently, when an exception is thrown in the private method ActiveSupport::Cache::FileStore#read_entry, the exception is rescued and the method fails silently.

Besides failing gracefully, we should also log the exception so that it's easily debuggable.

This follows the convention in ActiveSupport::Cache::MemCacheStore#read_entry which logs the exception when one is thrown.

Thanks!

@isaacsanders

Is this still an issue?

@winston
winston commented May 5, 2012

Yup. I just checked https://github.com/rails/rails/blob/master/activesupport/lib/active_support/cache/file_store.rb#L79 on master and it still doesn't have any exception logging.

However, looking at https://github.com/rails/rails/blob/master/activesupport/lib/active_support/cache/mem_cache_store.rb#L128, you will see that along with rescuing the exception, the exception is logged and this allows anyone to review the error easily.

So the exception in file store should be logged too, as part of the convention, and to aid in debugging the error.

Thanks!

@NZKoz NZKoz merged commit e44009a into rails:master May 22, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.