aboutsummaryrefslogtreecommitdiffstats
path: root/actionmailer/CHANGELOG.md
diff options
context:
space:
mode:
authorJeremy Daer <jeremydaer@gmail.com>2016-05-13 17:43:48 -0700
committerJeremy Daer <jeremydaer@gmail.com>2016-05-15 18:44:16 -0700
commite35b98e6f5c54330245645f2ed40d56c74538902 (patch)
tree272bba30020bde27d177d2cf6227dfa8bb7a525f /actionmailer/CHANGELOG.md
parent6810847f495cd282c2659be738ac8271ecdec12f (diff)
downloadrails-e35b98e6f5c54330245645f2ed40d56c74538902.tar.gz
rails-e35b98e6f5c54330245645f2ed40d56c74538902.tar.bz2
rails-e35b98e6f5c54330245645f2ed40d56c74538902.zip
Action Mailer: Declarative exception handling with `rescue_from`.
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`.
Diffstat (limited to 'actionmailer/CHANGELOG.md')
-rw-r--r--actionmailer/CHANGELOG.md4
1 files changed, 4 insertions, 0 deletions
diff --git a/actionmailer/CHANGELOG.md b/actionmailer/CHANGELOG.md
index d45e74133a..3b9f503a0b 100644
--- a/actionmailer/CHANGELOG.md
+++ b/actionmailer/CHANGELOG.md
@@ -1,2 +1,6 @@
+* Exception handling: use `rescue_from` to handle exceptions raised by
+ mailer actions, by message delivery, and by deferred delivery jobs.
+
+ *Jeremy Daer*
Please check [5-0-stable](https://github.com/rails/rails/blob/5-0-stable/actionmailer/CHANGELOG.md) for previous changes.