Story#117124725 - raise an error ConfirmingRegistrant Change job

This commit is contained in:
Vladimir Krylov 2016-04-07 16:45:44 +03:00
parent 00948384a6
commit 1d5a79f406

View file

@ -7,8 +7,13 @@ class DomainUpdateConfirmJob < Que::Job
case action case action
when RegistrantVerification::CONFIRMED when RegistrantVerification::CONFIRMED
domain.poll_message!(:poll_pending_update_confirmed_by_registrant) domain.poll_message!(:poll_pending_update_confirmed_by_registrant)
raise_errors!(domain)
domain.apply_pending_update! domain.apply_pending_update!
raise_errors!(domain)
domain.clean_pendings! domain.clean_pendings!
raise_errors!(domain)
when RegistrantVerification::REJECTED when RegistrantVerification::REJECTED
domain.send_mail :pending_update_rejected_notification_for_new_registrant domain.send_mail :pending_update_rejected_notification_for_new_registrant
domain.poll_message!(:poll_pending_update_rejected_by_registrant) domain.poll_message!(:poll_pending_update_rejected_by_registrant)
@ -17,4 +22,8 @@ class DomainUpdateConfirmJob < Que::Job
destroy # it's best to destroy the job in the same transaction destroy # it's best to destroy the job in the same transaction
end end
end end
def raise_errors!(domain)
throw "domain #{domain.name} failed with errors #{domain.errors.full_messages}" if domain.errors.any?
end
end end