rails/activejob/test/jobs/raising_job.rb

12 lines
221 B
Ruby

# frozen_string_literal: true
class RaisingJob < ActiveJob::Base
MyError = Class.new(StandardError)
retry_on(MyError, attempts: 2)
def perform(error = "RaisingJob::MyError")
raise error.constantize
end
end