summaryrefslogtreecommitdiff
path: root/lib/solidus_subscriptions/engine.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/solidus_subscriptions/engine.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/solidus_subscriptions/engine.rb')
-rw-r--r--lib/solidus_subscriptions/engine.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/solidus_subscriptions/engine.rb b/lib/solidus_subscriptions/engine.rb
index 0f274d8..2d361cf 100644
--- a/lib/solidus_subscriptions/engine.rb
+++ b/lib/solidus_subscriptions/engine.rb
@@ -6,6 +6,7 @@ require 'solidus_subscriptions'
require 'solidus_subscriptions/permitted_attributes'
require 'solidus_subscriptions/configuration'
require 'solidus_subscriptions/processor'
+require 'solidus_subscriptions/processing_error_handlers/rails_logger'
module SolidusSubscriptions
class Engine < Rails::Engine