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("Elapsed time: #{Time.at(elapsed).utc.strftime('%H:%M:%S')}")
# do nothing on interrupt
rescue Interrupt
# do nothing on interrupt
exit(1)
# Error on Updating
rescue ChecksumError => e
puts critical(e.message)
puts critical('Downloaded File Content:')
puts e.file[0..500]
puts '.........'
puts
if e.file
puts critical('Downloaded File Content:')
puts e.file[0..500]
puts '.........'
puts
end
if e.cloudflare_info
puts critical('Cloudflare Info:')
puts e.cloudflare_info
puts
end
puts critical('Please submit this info as an Github issue')
exit(1)
rescue => e
puts
puts critical(e.message)