FIX: Log errors in `ensure` block of restorer.

This commit is contained in:
Guo Xiang Tan 2016-07-22 12:14:35 +08:00
parent 03aa13b2bb
commit 76e57ddef3
1 changed files with 7 additions and 2 deletions

View File

@ -68,8 +68,13 @@ module BackupRestore
else
@success = true
ensure
notify_user rescue nil
begin
notify_user
clean_up
rescue => ex
Rails.logger.error("#{ex}\n" + ex.backtrace.join("\n"))
end
@success ? log("[SUCCESS]") : log("[FAILED]")
end