From 9d8d4ee05e08b928dbb25bb14e49ea28f30d14c6 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Mon, 1 Aug 2016 16:51:11 -0700 Subject: Allow for custom handling of exceptions that persist beyond the retry attempts --- activejob/test/cases/exceptions_test.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'activejob/test/cases') diff --git a/activejob/test/cases/exceptions_test.rb b/activejob/test/cases/exceptions_test.rb index 0bc1d82623..d2757c9074 100644 --- a/activejob/test/cases/exceptions_test.rb +++ b/activejob/test/cases/exceptions_test.rb @@ -45,6 +45,11 @@ class ExceptionsTest < ActiveSupport::TestCase RetryJob.perform_later 'DiscardableError', 2 assert_equal "Raised DiscardableError for the 1st time", JobBuffer.last_value end + + test "custom handling of job that exceeds retry attempts" do + RetryJob.perform_later 'CustomCatchError', 6 + assert_equal "Dealt with a job that failed to retry in a custom way", JobBuffer.last_value + end end class ExponentiallyBackoffExceptionsTest < ActiveJob::TestCase -- cgit v1.2.3