lib/backup/cli.rb in backup-4.0.3 vs lib/backup/cli.rb in backup-4.0.4
- old
+ new
@@ -140,10 +140,13 @@
# Finalize Logger and begin real-time logging.
Logger.start!
rescue Exception => err
Logger.error Error.wrap(err)
+ unless Helpers.is_backup_error? err
+ Logger.error err.backtrace.join("\n")
+ end
# Logger configuration will be ignored
# and messages will be output to the console only.
Logger.abort!
exit(3)
end
@@ -217,10 +220,13 @@
def check
begin
Config.load(options)
rescue Exception => err
Logger.error Error.wrap(err)
+ unless Helpers.is_backup_error? err
+ Logger.error err.backtrace.join("\n")
+ end
end
if Logger.has_warnings? || Logger.has_errors?
Logger.error 'Configuration Check Failed.'
exit_code = 1
@@ -353,9 +359,13 @@
end
def exec!(cmd)
puts "Launching: #{ cmd }"
exec(cmd)
+ end
+
+ def is_backup_error?(error)
+ error.class.ancestors.include? Backup::Error
end
end
end