mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-10-06 20:05:55 +08:00
Fix failes docx generation when you can not find image [SCI-11037]
This commit is contained in:
parent
a11615cbf5
commit
396c042ff8
1 changed files with 13 additions and 1 deletions
|
@ -92,7 +92,19 @@ module Reports
|
||||||
end
|
end
|
||||||
|
|
||||||
if elem.name == 'img'
|
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
|
next
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue