mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
e35b98e6f5
Follows the same pattern as controllers and jobs. Exceptions raised in delivery jobs (enqueued by `#deliver_later`) are also delegated to the mailer's rescue_from handlers, so you can handle the DeserializationError raised by delivery jobs: ```ruby class MyMailer < ApplicationMailer rescue_from ActiveJob::DeserializationError do … end ``` ActiveSupport::Rescuable polish: * Add the `rescue_with_handler` class method so exceptions may be handled at the class level without requiring an instance. * Rationalize `exception.cause` handling. If no handler matches the exception, fall back to the handler that matches its cause. * Handle exceptions raised elsewhere. Pass `object: …` to execute the `rescue_from` handler (e.g. a method call or a block to instance_exec) against a different object. Defaults to `self`. |
||
---|---|---|
.. | ||
fixtures | ||
mailers | ||
abstract_unit.rb | ||
assert_select_email_test.rb | ||
asset_host_test.rb | ||
base_test.rb | ||
caching_test.rb | ||
delivery_methods_test.rb | ||
i18n_with_controller_test.rb | ||
log_subscriber_test.rb | ||
mail_helper_test.rb | ||
mail_layout_test.rb | ||
message_delivery_test.rb | ||
test_case_test.rb | ||
test_helper_test.rb | ||
url_test.rb |