Module: LogStruct::Integrations::ActionMailer::FallbackErrorHandlers
- Extended by:
- T::Helpers, T::Sig
- Includes:
- Handlers
- Defined in:
- lib/log_struct/integrations/action_mailer/fallback_error_handlers.rb
Overview
The error handlers a mailer can name in rescue_from (with: :log_and_ignore_error), for processes where LogStruct doesn't set up ActionMailer (development, the console and Rake tasks by default). Without them those mailers raised NameError there. Each logs the error with the mailer's logger, then ignores it, reports it to Rails.error, or raises it again, as its name says.
Defined Under Namespace
Modules: ClassMethods, Handlers
Class Method Summary collapse
Methods included from Handlers
#log_and_ignore_error, #log_and_report_error, #log_and_reraise_error
Class Method Details
.handle(logger, error, report:, reraise:) ⇒ void
This method returns an undefined value.
21 22 23 24 25 |
# File 'lib/log_struct/integrations/action_mailer/fallback_error_handlers.rb', line 21 def handle(logger, error, report:, reraise:) logger&.error("#{error.class}: #{error.}") ::Rails.error.report(error, handled: true, source: "logstruct.action_mailer") if report Kernel.raise error if reraise end |