File tree 2 files changed +2
-0
lines changed
2 files changed +2
-0
lines changed Original file line number Diff line number Diff line change @@ -179,6 +179,7 @@ class ThingsController < ApplicationController
179
179
no_background: true ,
180
180
viewport_size: ' TEXT' , # available only with use_xserver or patched QT
181
181
extra: ' ' , # directly inserted into the command to wkhtmltopdf
182
+ raise_on_all_errors: nil , # raise error for any stderr output. Such as missing media, image assets
182
183
outline: { outline: true ,
183
184
outline_depth: LEVEL },
184
185
margin: { top: SIZE , # default 10 (mm)
Original file line number Diff line number Diff line change @@ -85,6 +85,7 @@ def pdf_from_url(url, options = {})
85
85
generated_pdf_file . rewind
86
86
generated_pdf_file . binmode
87
87
pdf = generated_pdf_file . read
88
+ raise "Error generating PDF\n Command Error: #{ err } " if options [ :raise_on_all_errors ] && !err . empty?
88
89
raise "PDF could not be generated!\n Command Error: #{ err } " if pdf && pdf . rstrip . empty?
89
90
pdf
90
91
rescue StandardError => e
You can’t perform that action at this time.
0 commit comments