Module: LogStruct::Integrations::ActionMailer::ErrorHandling
- Extended by:
- ActiveSupport::Concern, T::Sig
- Defined in:
- lib/log_struct/integrations/action_mailer/error_handling.rb
Overview
Handles error handling for ActionMailer
IMPORTANT LIMITATIONS:
- This module must be included BEFORE users define rescue_from handlers to ensure proper handler precedence (user handlers are checked first)
- Rails rescue_from handlers don't bubble to parent class handlers after reraise
- Handler order matters: Rails checks rescue_from handlers in reverse declaration order
Instance Attribute Summary collapse
-
#logstruct_mail_failed ⇒ Object
Returns the value of attribute logstruct_mail_failed.
Class Method Summary collapse
Instance Attribute Details
#logstruct_mail_failed ⇒ Object
Returns the value of attribute logstruct_mail_failed.
19 20 21 |
# File 'lib/log_struct/integrations/action_mailer/error_handling.rb', line 19 def logstruct_mail_failed @logstruct_mail_failed end |
Class Method Details
.install_handler(base) ⇒ Object
27 28 29 30 31 32 33 34 35 36 |
# File 'lib/log_struct/integrations/action_mailer/error_handling.rb', line 27 def self.install_handler(base) # Only add the handler once per class return if base.instance_variable_get(:@_logstruct_handler_installed) # Add our handler FIRST so it has lower priority than user handlers base.rescue_from StandardError, with: :log_and_reraise_error # Mark as installed to prevent duplicates base.instance_variable_set(:@_logstruct_handler_installed, true) end |
.prepended(base) ⇒ Object
44 45 46 |
# File 'lib/log_struct/integrations/action_mailer/error_handling.rb', line 44 def self.prepended(base) install_handler(base) end |