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:
@@ -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
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user