lib/backtracer.rb in backtracer-0.3.0 vs lib/backtracer.rb in backtracer-0.4.0
- old
+ new
@@ -2,12 +2,12 @@
require File.dirname(__FILE__) + "/shared"
require 'sane'
at_exit {
- if $!
- puts "==== " + $!.inspect + ' ' + $!.to_s
+ if $! && !$!.is_a?(SystemExit) # SystemExit's are just normal, not exceptional
+ puts "==== ", $!.inspect + ' ' + $!.to_s
bt2 = $!.backtrace
backtrace_with_code = $!.backtrace.map{ |bt_line|
if OS.windows? && bt_line[1..1] == ':'
#["C", "/dev/ruby/allgems/lib/allgems/GemWorker.rb", "91", "in `unpack'"]
drive, file, line, junk = bt_line.split(":")
@@ -21,10 +21,10 @@
"#{bt_line}\n\t#{actual_line.strip if actual_line}"
}
puts backtrace_with_code
puts "===="
else
- puts "(no exception found to backtrace)"
+ puts "(no exception found to backtrace)" if $VERBOSE
end
# exit! TODO I guess do this once ours isn't *so* ugly
# TODO compare with that fella xray
}