dump_config for certain exceptions

Ideally we could do a get request and fill in the issue form at GitHub. Presumably though, we'd only do this if the user typed brew report or somesuch.

Someone should get that implemented!
This commit is contained in:
Max Howell 2009-11-11 18:38:50 +00:00
parent 8c21cd4c64
commit fffa3eb22f

View File

@ -236,37 +236,27 @@ begin
end end
rescue FormulaUnspecifiedError rescue FormulaUnspecifiedError
puts "This command requires a formula argument" abort "This command requires a formula argument"
exit 1
rescue KegUnspecifiedError rescue KegUnspecifiedError
puts "This command requires a keg argument" abort "This command requires a keg argument"
exit 1
rescue UsageError rescue UsageError
onoe "Invalid usage" onoe "Invalid usage"
puts ARGV.usage abort ARGV.usage
exit 1
rescue SystemExit rescue SystemExit
puts "Kernel.exit" if ARGV.verbose? puts "Kernel.exit" if ARGV.verbose?
exit 1
rescue Interrupt => e rescue Interrupt => e
puts # seemingly a newline is typical puts # seemingly a newline is typical
exit 130 exit 130
rescue SystemCallError, RuntimeError => e
if ARGV.debug?
onoe e.inspect
puts e.backtrace
else
onoe e
if e.kind_of? BuildError
puts please_report_bug
puts "Exit Status: #{e.status}"
end
end
exit 1
rescue Exception => e rescue Exception => e
onoe "Homebrew has failed you :(" fatal = !(RuntimeError === e or SystemCallError === e)
puts please_report_bug
puts e.inspect onoe e
puts e.backtrace if BuildError === e or fatal
puts "#{Tty.white}Please report this bug to #{Tty.em}#{HOMEBREW_WWW}#{Tty.reset}"
dump_config
puts "Exit status: #{e.status}" if BuildError === e
end
puts e.backtrace if fatal or ARGV.debug?
exit 1 exit 1
end end