Sha256: 9598073a18ca86210825ba8e7856fb7fddd9855261a35a4693752191301c8aed

Contents?: true

Size: 751 Bytes

Versions: 11

Compression:

Stored size: 751 Bytes

Contents

# frozen_string_literal: true

module ActionMailer # :nodoc:
  # Provides
  # {rescue_from}[rdoc-ref:ActiveSupport::Rescuable::ClassMethods#rescue_from]
  # for mailers. Wraps mailer action processing, mail job processing, and mail
  # delivery to handle configured errors.
  module Rescuable
    extend ActiveSupport::Concern
    include ActiveSupport::Rescuable

    class_methods do
      def handle_exception(exception) # :nodoc:
        rescue_with_handler(exception) || raise(exception)
      end
    end

    def handle_exceptions # :nodoc:
      yield
    rescue => exception
      rescue_with_handler(exception) || raise
    end

    private
      def process(...)
        handle_exceptions do
          super
        end
      end
  end
end

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
actionmailer-7.0.8.7 lib/action_mailer/rescuable.rb
actionmailer-7.0.8.6 lib/action_mailer/rescuable.rb
actionmailer-7.0.8.5 lib/action_mailer/rescuable.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/actionmailer-7.0.8.4/lib/action_mailer/rescuable.rb
actionmailer-7.0.8.4 lib/action_mailer/rescuable.rb
actionmailer-7.0.8.1 lib/action_mailer/rescuable.rb
actionmailer-7.0.8 lib/action_mailer/rescuable.rb
actionmailer-7.0.7.2 lib/action_mailer/rescuable.rb
actionmailer-7.0.7.1 lib/action_mailer/rescuable.rb
actionmailer-7.0.7 lib/action_mailer/rescuable.rb
actionmailer-7.0.6 lib/action_mailer/rescuable.rb