Sha256: 18c3b22cc5ac73c1eca9327d2903bd22ecb85211e9fccb3fdd7c8fe003885421

Contents?: true

Size: 786 Bytes

Versions: 40

Compression:

Stored size: 786 Bytes

Contents

# frozen_string_literal: true

module ActionMailer # :nodoc:
  # = Action Mailer \Rescuable
  #
  # 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

40 entries across 40 versions & 5 rubygems

Version Path
omg-actionmailer-8.0.0.alpha2 lib/action_mailer/rescuable.rb
actionmailer-7.1.4 lib/action_mailer/rescuable.rb
actionmailer-7.2.1 lib/action_mailer/rescuable.rb
actionmailer-7.2.0 lib/action_mailer/rescuable.rb
actionmailer-7.2.0.rc1 lib/action_mailer/rescuable.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/actionmailer-7.1.3.4/lib/action_mailer/rescuable.rb
actionmailer-7.2.0.beta3 lib/action_mailer/rescuable.rb
tinymce-rails-7.1.2 vendor/bundle/ruby/3.3.0/gems/actionmailer-7.1.3.4/lib/action_mailer/rescuable.rb
actionmailer-7.2.0.beta2 lib/action_mailer/rescuable.rb
actionmailer-7.1.3.4 lib/action_mailer/rescuable.rb
actionmailer-7.2.0.beta1 lib/action_mailer/rescuable.rb
actionmailer-7.1.3.2 lib/action_mailer/rescuable.rb
actionmailer-7.1.3.1 lib/action_mailer/rescuable.rb
actionmailer-7.1.3 lib/action_mailer/rescuable.rb
actionmailer-7.1.2 lib/action_mailer/rescuable.rb
actionmailer-7.1.1 lib/action_mailer/rescuable.rb
actionmailer-7.1.0 lib/action_mailer/rescuable.rb
actionmailer-7.1.0.rc2 lib/action_mailer/rescuable.rb
actionmailer-7.1.0.rc1 lib/action_mailer/rescuable.rb
actionmailer-7.1.0.beta1 lib/action_mailer/rescuable.rb