whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject [whimsy] branch master updated: Detect conversion failure
Date Wed, 24 Oct 2018 09:45:10 GMT
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 <sebb@apache.org>
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'
 


Mime
View raw message