migrator: better exception printing

This commit is contained in:
Xu Cheng 2015-08-15 20:37:24 +08:00
parent f83d418608
commit 48f260f674

View File

@ -142,8 +142,9 @@ class Migrator
rescue Interrupt
ignore_interrupts { backup_oldname }
rescue Exception => e
onoe "error occured while migrating."
puts e if ARGV.debug?
onoe "Error occured while migrating."
puts e
puts e.backtrace if ARGV.debug?
puts "Backuping..."
ignore_interrupts { backup_oldname }
end
@ -220,9 +221,9 @@ class Migrator
rescue Exception => e
onoe "An unexpected error occurred during linking"
puts e
puts e.backtrace
puts e.backtrace if ARGV.debug?
ignore_interrupts { keg.unlink }
raise e
raise
end
end