Skip to content

Commit

Permalink
stamp pdf better error logging
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudmagic80 committed Dec 2, 2024
1 parent 5a20cdf commit bbc8b67
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions modules/ivc_champva/app/services/ivc_champva/pdf_stamper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,14 @@ class PdfStamper
SUBMISSION_DATE_TITLE = 'Application Submitted:'

def self.stamp_pdf(stamped_template_path, form, current_loa)
if File.exist? stamped_template_path
stamp_signature(stamped_template_path, form)
return unless File.exist?(stamped_template_path)

stamp_auth_text(stamped_template_path, current_loa)

stamp_submission_date(stamped_template_path, form.submission_date_stamps)
else
raise "stamped template file does not exist: #{stamped_template_path}"
end
stamp_signature(stamped_template_path, form)
stamp_auth_text(stamped_template_path, current_loa)
stamp_submission_date(stamped_template_path, form.submission_date_stamps)
rescue => e
Rails.logger.error "Error stamping PDF: #{e.message}"
raise "Error stamping PDF: #{stamped_template_path}"
end

def self.stamp_signature(stamped_template_path, form)
Expand Down

0 comments on commit bbc8b67

Please sign in to comment.