Skip to content

Rubocop: Discourage catching `QueryCanceled` exceptions

Add a rubocop to discourage this pattern:

begin
  run_an_expensive_long_query()
rescue ActiveRecord::QueryCanceled => e
  do_something_else()
end

Using this pattern should be a very rare exception or a temporary patch only.