Why this matters
Prevents accidentally catching system-level exceptions and improves observability.
Avoid bare `rescue`; rescue StandardError (or a narrower class) and log with context.
Prevents accidentally catching system-level exceptions and improves observability.
Side-by-side examples engineers can pattern-match during review.
begin
risky
rescue
# swallowed
endbegin
risky
rescue StandardError => e
Rails.logger.error("risky failed", error: e)
raise
endrescue; endrescue StandardError => e; log; raiseFrom the same buckets as this rule.
Check if loops use equality operators (== or !=) in termination conditions. These can lead to infinite loops if the condition is never met exactly. Instead, use relational operators like < or > for safer loop termination.