From d85ab79fcac2f5679dd3ff4bdf42e228d088862d Mon Sep 17 00:00:00 2001 From: Bell Isabell Date: Tue, 3 Mar 2026 18:51:31 -0800 Subject: [PATCH] Fix: rescue StandardError instead of Exception in PublishPostJob Rescuing Exception catches SystemExit, Interrupt, SignalException, and other critical errors that should not be caught. StandardError is the correct base class for rescuing application-level errors. Closes #24 --- app/jobs/publish_post_job.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/jobs/publish_post_job.rb b/app/jobs/publish_post_job.rb index 0bd03bb..5afd4b0 100644 --- a/app/jobs/publish_post_job.rb +++ b/app/jobs/publish_post_job.rb @@ -11,7 +11,7 @@ def perform(*posts) # rubocop:disable Metrics/MethodLength post.account.subscriptions.active.find_each do |subscription| AccountMailer.new_post(post, subscription).deliver_now - rescue Exception => e # rubocop:disable Lint/RescueException + rescue StandardError => e Rails.logger.error "Error sending post to #{subscription.email_address.email}: #{e}" # For AWS SES bounces and complaints, we may want to add specific error handling later end