This is an automated email from the ASF dual-hosted git repository.
sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git
The following commit(s) were added to refs/heads/master by this push:
new 652c8bc Detect conversion failure
652c8bc is described below
commit 652c8bcb3ae5e513d842624b0c47fa411979b9b6
Author: Sebb <[email protected]>
AuthorDate: Wed Oct 24 10:45:00 2018 +0100
Detect conversion failure
---
www/secretary/workbench/views/actions/pdfize.json.rb | 3 +++
1 file changed, 3 insertions(+)
diff --git a/www/secretary/workbench/views/actions/pdfize.json.rb
b/www/secretary/workbench/views/actions/pdfize.json.rb
index 0d9077c..a38d865 100644
--- a/www/secretary/workbench/views/actions/pdfize.json.rb
+++ b/www/secretary/workbench/views/actions/pdfize.json.rb
@@ -12,6 +12,9 @@ begin
name = @selected.sub(/\.\w+$/, '') + '.pdf'
+ # If output file is empty, then the command failed
+ raise "Failed to pdf-ize #{@selected} in #{@message}" unless File.size?
source.path
+
message.update_attachment @selected, content: source.read, name: name,
mime: 'application/pdf'