summaryrefslogtreecommitdiff
path: root/app/controllers/trigger_controller.rb
diff options
context:
space:
mode:
authorStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-07-01 13:02:23 +0200
committerStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-07-01 13:02:23 +0200
commitf4f1d36b31e65ee9dbf2741d4d80e4082c1721bb (patch)
tree9ef10914b9d77f3b982b5eccec0c0fca608389f5 /app/controllers/trigger_controller.rb
parent2037440f77015cb22f18673399bf51a917d405f8 (diff)
parent6ae8daa7c11a50a5fc538376158ee74f31d690b3 (diff)
Merge branch 'develop' of github.com:amooma/GS5 into develop
Diffstat (limited to 'app/controllers/trigger_controller.rb')
-rw-r--r--app/controllers/trigger_controller.rb14
1 files changed, 12 insertions, 2 deletions
diff --git a/app/controllers/trigger_controller.rb b/app/controllers/trigger_controller.rb
index 3dbb2a5..290a1fc 100644
--- a/app/controllers/trigger_controller.rb
+++ b/app/controllers/trigger_controller.rb
@@ -135,8 +135,18 @@ class TriggerController < ApplicationController
working_path, tiff_file = File.split(fax_document.tiff)
if fax_document.store_dir != working_path
- FileUtils.mkdir(fax_document.store_dir)
- FileUtils.mv(fax_document.tiff, fax_document.store_dir)
+ begin
+ FileUtils.mkdir(fax_document.store_dir)
+ rescue => e
+ logger.error "PDF fax directory not created: #{fax_document.store_dir} => #{e.inspect}"
+ end
+
+ begin
+ FileUtils.mv(fax_document.tiff, fax_document.store_dir)
+ rescue => e
+ logger.error "PDF fax files not moved: #{fax_document.tiff} => #{e.inspect}"
+ end
+
fax_document.tiff = "#{fax_document.store_dir}/#{tiff_file}"
end