From e925917e6f98a6f0f8cbe99b26cfaf19f5a8a507 Mon Sep 17 00:00:00 2001 From: Rubocop Challenger Date: Tue, 11 Apr 2023 23:33:16 +0000 Subject: [PATCH 1/3] :police_car: regenerate rubocop todo --- .rubocop_todo.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 90366f7..fc6b4f8 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,6 +1,6 @@ # This configuration was generated by # `rubocop --auto-gen-config --exclude-limit 180` -# on 2023-03-21 23:33:15 UTC using RuboCop version 1.48.1. +# on 2023-04-11 23:33:15 UTC using RuboCop version 1.50.0. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new From 892a67a772c51888de01ea3621e80e0e01c1e832 Mon Sep 17 00:00:00 2001 From: Rubocop Challenger Date: Tue, 11 Apr 2023 23:33:23 +0000 Subject: [PATCH 2/3] :police_car: Naming/RescuedExceptionsVariableName --- .rubocop_todo.yml | 7 ------- lib/dispatch-rider/demultiplexer.rb | 14 +++++++------- lib/dispatch-rider/logging/lifecycle_logger.rb | 6 +++--- 3 files changed, 10 insertions(+), 17 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index fc6b4f8..3c78738 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -115,13 +115,6 @@ Naming/AccessorMethodName: - 'lib/dispatch-rider/handlers/base.rb' - 'lib/dispatch-rider/scheduled_job.rb' -# Offense count: 4 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: PreferredName. -Naming/RescuedExceptionsVariableName: - Exclude: - - 'lib/dispatch-rider/demultiplexer.rb' - - 'lib/dispatch-rider/logging/lifecycle_logger.rb' # Offense count: 10 RSpec/AnyInstance: diff --git a/lib/dispatch-rider/demultiplexer.rb b/lib/dispatch-rider/demultiplexer.rb index e412ae4..e83276d 100644 --- a/lib/dispatch-rider/demultiplexer.rb +++ b/lib/dispatch-rider/demultiplexer.rb @@ -22,8 +22,8 @@ def start sleep 1 handle_next_queue_item - rescue => exception - error_handler.call(Message.new(subject: "TopLevelError", body: {}), exception) + rescue => e + error_handler.call(Message.new(subject: "TopLevelError", body: {}), e) throw :done end @@ -49,8 +49,8 @@ def dispatch_message(message) with_current_message(message) do dispatcher.dispatch(message) end - rescue => exception - handle_message_error message, exception + rescue => e + handle_message_error message, e false end @@ -75,9 +75,9 @@ def handle_next_queue_item def handle_message_error(message, exception) error_handler.call(message, exception) - rescue => error_handler_exception # the error handler crashed - Logging::LifecycleLogger.log_error_handler_fail message, error_handler_exception - raise error_handler_exception + rescue => e # the error handler crashed + Logging::LifecycleLogger.log_error_handler_fail message, e + raise e end def logger diff --git a/lib/dispatch-rider/logging/lifecycle_logger.rb b/lib/dispatch-rider/logging/lifecycle_logger.rb index 5b477a5..ee34e68 100644 --- a/lib/dispatch-rider/logging/lifecycle_logger.rb +++ b/lib/dispatch-rider/logging/lifecycle_logger.rb @@ -17,9 +17,9 @@ def wrap_handling(message) log_start(message) yield log_success(message) - rescue => exception - log_fail(message, exception) - raise exception + rescue => e + log_fail(message, e) + raise e ensure log_complete(message, Time.now - start_time) end From 31e5f695bf5472f5d9a42b90cfa32aa85a7a4375 Mon Sep 17 00:00:00 2001 From: Rubocop Challenger Date: Tue, 11 Apr 2023 23:33:33 +0000 Subject: [PATCH 3/3] :police_car: regenerate rubocop todo --- .rubocop_todo.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 3c78738..a638b3c 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,6 +1,6 @@ # This configuration was generated by # `rubocop --auto-gen-config --exclude-limit 180` -# on 2023-04-11 23:33:15 UTC using RuboCop version 1.50.0. +# on 2023-04-11 23:33:33 UTC using RuboCop version 1.50.0. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new @@ -115,7 +115,6 @@ Naming/AccessorMethodName: - 'lib/dispatch-rider/handlers/base.rb' - 'lib/dispatch-rider/scheduled_job.rb' - # Offense count: 10 RSpec/AnyInstance: Exclude: