lib/backtracer.rb in backtracer-0.6.1 vs lib/backtracer.rb in backtracer-0.6.2
- old
+ new
@@ -4,11 +4,13 @@
require File.dirname(__FILE__) + "/shared"
at_exit {
if $! && !$!.is_a?(SystemExit) # SystemExit's are normal, not exceptional
- print "\n\t" unless defined?($same_line)
+ print "\n"
+ print "\t" unless defined?($same_line)
+
puts $!.inspect + ' ' + $!.to_s
max = 0
$!.backtrace.each{|bt_line| max = [bt_line.length, max].max}
@@ -27,10 +29,11 @@
"%-#{max + 1}s #{"\n\t" unless defined?($same_line)}%s" % [bt_line, (actual_line.strip if actual_line)]
}.compact
puts backtrace_with_code
puts # blank line
- $!.set_backtrace [] # avoid the original backtrace being outputted--though annoyingly it does still output its #to_s...
+ # for some reason this can be nil...
+ $!.set_backtrace [] if $! # avoid the original backtrace being outputted--though annoyingly it does still output its #to_s...
else
puts "(backtracer: no exception found to backtrace)" if $VERBOSE
end
# exit! TODO I guess do this once ours isn't *so* ugly