Merge pull request #7857 from rekonder/aj_SCI_11037

Fix failed docx generation when you can not find image [SCI-11037]
This commit is contained in:
ajugo 2024-09-17 09:53:41 +02:00 committed by GitHub
commit 47b3a256fa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -92,7 +92,19 @@ module Reports
end
if elem.name == 'img'
elements.push(img_element(elem))
begin
elements.push(img_element(elem))
rescue StandardError => e
Rails.logger.error e.message
Rails.logger.error(e.backtrace.join("\n"))
elements.push(
type: 'text',
value: I18n.t('projects.reports.index.generation.file_preview_generation_error'),
style: { italic: true }
)
end
next
end