Add and apply Naming/RescuedExceptionsVariableName rubocop rule

This rule was introduced in RuboCop 0.67.2, but now after seeing a fix in version 1.65.1,
we have decided to add it. The reason for adding it is to ensure consistency in how we
reference exceptions throughout the project, by following a standard naming convention
for exception variables.
This commit is contained in:
taitus
2024-10-09 10:14:08 +02:00
parent 6b15a073a2
commit 4dcac5bed5
2 changed files with 6 additions and 3 deletions

View File

@@ -337,6 +337,9 @@ Naming/BlockForwarding:
- "app/controllers/management/base_controller.rb"
- "app/controllers/subscriptions_controller.rb"
Naming/RescuedExceptionsVariableName:
Enabled: true
Naming/VariableName:
Enabled: true

View File

@@ -62,9 +62,9 @@ class MachineLearning
job.update!(finished_at: Time.current)
Mailer.machine_learning_success(user).deliver_later
rescue Exception => error
handle_error(error)
raise error
rescue Exception => e
handle_error(e)
raise e
end
end
handle_asynchronously :run, queue: "machine_learning"