summaryrefslogtreecommitdiff
path: root/lib/generators/solidus_subscriptions/install/templates/initializer.rb
diff options
context:
space:
mode:
authorAlberto Vena <kennyadsl@gmail.com>2021-07-12 15:29:53 +0200
committerAlberto Vena <kennyadsl@gmail.com>2021-07-13 16:22:59 +0200
commitc9e26197b0abbe50b029c368017243314d572884 (patch)
tree751072edbfae746e21045bdc027606c48c2670d2 /lib/generators/solidus_subscriptions/install/templates/initializer.rb
parent662719693c9f369cd9176e432ab3d4a554822751 (diff)
Logs an error in the Rails logs when installment processing fails
At the moment, by default, all installment prceissing errors are swallowed and there's no way for a developer to understand what's happening. Of course they can create a custom handler with the processing_error_handler configuration provided but usually, when the first errors happen, it's too late and those errors are lost. We are not raising errors of this job because if there's a retry mechanism in place for Active Job, the installment will be reprocessed twice. Once by Active Job and once by the installment retry mechanism already provided by the extension. Logging to Rails.error is a middle-ground that allows to intercept the message of the exception. Still, creating a custom handler based on the bug tracker/exception handler used is the suggested option here.
Diffstat (limited to 'lib/generators/solidus_subscriptions/install/templates/initializer.rb')
-rw-r--r--lib/generators/solidus_subscriptions/install/templates/initializer.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/generators/solidus_subscriptions/install/templates/initializer.rb b/lib/generators/solidus_subscriptions/install/templates/initializer.rb
index de1d081..7ca79c5 100644
--- a/lib/generators/solidus_subscriptions/install/templates/initializer.rb
+++ b/lib/generators/solidus_subscriptions/install/templates/initializer.rb
@@ -31,7 +31,9 @@ SolidusSubscriptions.configure do |config|
# on an error tracking system.
# Though not recommended due to the retry mechanisms built into this gem, the error can be
# re-raised if the default retry behaviour is required in ActiveJob.
- # config.processing_error_handler = nil
+ #
+ # By default, it only logs the error message using Rails.logger.error.
+ # config.processing_error_handler = SolidusSubscriptions::ProcessingErrorHandlers::RailsLogger
# ========================================= Dispatchers ==========================================
#