From 76e57ddef359d7563054d408fc83147355a96266 Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Fri, 22 Jul 2016 12:14:35 +0800 Subject: [PATCH] FIX: Log errors in `ensure` block of restorer. --- lib/backup_restore/restorer.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/backup_restore/restorer.rb b/lib/backup_restore/restorer.rb index a0a606e0c6b..bc9a067bd0d 100644 --- a/lib/backup_restore/restorer.rb +++ b/lib/backup_restore/restorer.rb @@ -68,8 +68,13 @@ module BackupRestore else @success = true ensure - notify_user rescue nil - clean_up + begin + notify_user + clean_up + rescue => ex + Rails.logger.error("#{ex}\n" + ex.backtrace.join("\n")) + end + @success ? log("[SUCCESS]") : log("[FAILED]") end