aboutsummaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorMax Howell2009-11-11 18:38:50 +0000
committerMax Howell2009-11-11 18:43:03 +0000
commitfffa3eb22f095ff28a096afad6d850bbbb5cdbff (patch)
tree0b908a5823a6f571c81326fffe54180c3453f1c5 /bin
parent8c21cd4c640acfaf858d9a5f8aed7c374106a1a6 (diff)
downloadbrew-fffa3eb22f095ff28a096afad6d850bbbb5cdbff.tar.bz2
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!
Diffstat (limited to 'bin')
-rwxr-xr-xbin/brew36
1 files changed, 13 insertions, 23 deletions
diff --git a/bin/brew b/bin/brew
index 509ed45b7..5c980ec2f 100755
--- a/bin/brew
+++ b/bin/brew
@@ -236,37 +236,27 @@ begin
end
rescue FormulaUnspecifiedError
- puts "This command requires a formula argument"
- exit 1
+ abort "This command requires a formula argument"
rescue KegUnspecifiedError
- puts "This command requires a keg argument"
- exit 1
+ abort "This command requires a keg argument"
rescue UsageError
onoe "Invalid usage"
- puts ARGV.usage
- exit 1
+ abort ARGV.usage
rescue SystemExit
puts "Kernel.exit" if ARGV.verbose?
- exit 1
rescue Interrupt => e
puts # seemingly a newline is typical
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
- onoe "Homebrew has failed you :("
- puts please_report_bug
- puts e.inspect
- puts e.backtrace
+ fatal = !(RuntimeError === e or SystemCallError === e)
+
+ onoe e
+ 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
end