Exit on exceptions

This commit is contained in:
Christian Mehlmauer
2016-08-12 23:56:36 +02:00
parent c0f5163d07
commit e942a5bcf6

View File

@@ -452,21 +452,28 @@ def main
puts info("Memory used: #{used_memory.bytes_to_human}") unless windows? puts info("Memory used: #{used_memory.bytes_to_human}") unless windows?
puts info("Elapsed time: #{Time.at(elapsed).utc.strftime('%H:%M:%S')}") puts info("Elapsed time: #{Time.at(elapsed).utc.strftime('%H:%M:%S')}")
rescue Interrupt
# do nothing on interrupt # do nothing on interrupt
rescue Interrupt
exit(1)
# Error on Updating # Error on Updating
rescue ChecksumError => e rescue ChecksumError => e
puts critical(e.message) puts critical(e.message)
if e.file
puts critical('Downloaded File Content:') puts critical('Downloaded File Content:')
puts e.file[0..500] puts e.file[0..500]
puts '.........' puts '.........'
puts puts
end
if e.cloudflare_info if e.cloudflare_info
puts critical('Cloudflare Info:') puts critical('Cloudflare Info:')
puts e.cloudflare_info puts e.cloudflare_info
puts puts
end end
puts critical('Please submit this info as an Github issue') puts critical('Please submit this info as an Github issue')
exit(1)
rescue => e rescue => e
puts puts
puts critical(e.message) puts critical(e.message)