diff --git a/actionpack/lib/action_controller/caching.rb b/actionpack/lib/action_controller/caching.rb index 46ef18c010ba..4c11bc99d887 100644 --- a/actionpack/lib/action_controller/caching.rb +++ b/actionpack/lib/action_controller/caching.rb @@ -292,11 +292,7 @@ def initialize end def read(name, options = {}) #:nodoc: - begin - @mutex.synchronize { @data[name] } - rescue - nil - end + @mutex.synchronize { @data[name] } rescue nil end def write(name, value, options = {}) #:nodoc: @@ -326,20 +322,14 @@ def initialize(cache_path) end def write(name, value, options = {}) #:nodoc: - begin - ensure_cache_path(File.dirname(real_file_path(name))) - File.open(real_file_path(name), "w+") { |f| f.write(value) } - rescue => e - Base.logger.info "Couldn't create cache directory: #{name} (#{e.message})" unless Base.logger.nil? - end + ensure_cache_path(File.dirname(real_file_path(name))) + File.open(real_file_path(name), "w+") { |f| f.write(value) } + rescue => e + Base.logger.info "Couldn't create cache directory: #{name} (#{e.message})" unless Base.logger.nil? end def read(name, options = {}) #:nodoc: - begin - IO.read(real_file_path(name)) - rescue - nil - end + IO.read(real_file_path(name)) rescue nil end def delete(name, options) #:nodoc: