Fix failes docx generation when you can not find image [SCI-11037]

This commit is contained in:
Andrej 2024-09-17 08:40:45 +02:00
parent a11615cbf5
commit 396c042ff8

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