Skip to content

Commit 3f81077

Browse files
Copilotnhorton
andcommitted
Use StandardError in rescue clauses instead of bare rescue
Co-authored-by: nhorton <[email protected]>
1 parent aee587a commit 3f81077

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/active_support/cache/source_control_cache_store.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def read_entry(key, **options)
6262

6363
# Create a new entry that never expires
6464
ActiveSupport::Cache::Entry.new(entry.value, expires_in: nil)
65-
rescue
65+
rescue StandardError
6666
# If we can't read or deserialize, treat as cache miss
6767
nil
6868
end
@@ -83,7 +83,7 @@ def write_entry(key, entry, **options)
8383
File.write(value_path(hash), serialize_entry(entry, **options))
8484

8585
true
86-
rescue
86+
rescue StandardError
8787
# Return false if write fails (permissions, disk space, etc.)
8888
false
8989
end
@@ -102,13 +102,13 @@ def delete_entry(key, **options)
102102

103103
begin
104104
deleted = true if File.exist?(key_file) && File.delete(key_file)
105-
rescue
105+
rescue StandardError
106106
# Ignore errors, continue trying to delete value file
107107
end
108108

109109
begin
110110
deleted = true if File.exist?(value_file) && File.delete(value_file)
111-
rescue
111+
rescue StandardError
112112
# Ignore errors
113113
end
114114

0 commit comments

Comments
 (0)