Skip to content

Commit

Permalink
Prevent silent failure logging when 4142 mailer is sent (#19432)
Browse files Browse the repository at this point in the history
Ensures the veteran-facing failure mailer we send when a 4142 document fails to upload for a Form 526 is the last thing that can raise an exception in the upload job's sidekiq_retries_exhausted block.
  • Loading branch information
NB28VT authored Nov 13, 2024
1 parent 705a29e commit 4b93cb6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/sidekiq/central_mail/submit_form4142_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ class CentralMailResponseError < Common::Exceptions::BackendServiceException; e
if Flipper.enabled?(:form526_send_4142_failure_notification)
EVSS::DisabilityCompensationForm::Form4142DocumentUploadFailureEmail.perform_async(form526_submission_id)
end
# NOTE: do NOT add any additional code here between the failure email being enqueued and the rescue block.
# The mailer prevents an upload from failing silently, since we notify the veteran and provide a workaround.
# The rescue will catch any errors in the sidekiq_retries_exhausted block and mark a "silent failure".
# This shouldn't happen if an email was sent; there should be no code here to throw an additional exception.
# The mailer should be the last thing that can fail.
rescue => e
cl = caller_locations.first
call_location = Logging::CallLocation.new(ZSF_DD_TAG_FUNCTION, cl.path, cl.lineno)
Expand Down

0 comments on commit 4b93cb6

Please sign in to comment.