Skip to content

Instantly share code, notes, and snippets.

@headius

headius/gist:282136

Created Jan 20, 2010
Embed
What would you like to do?
~/projects/jruby ➔ jruby --debug -rubygems example.rb
Attempt (1/3)
=== Stop! Hammertime. ===
An error has occurred at example.rb:6:in `faulty_method'
The error is: #<RuntimeError: Oh no!>
1. Continue (process the exception normally)
2. Ignore (proceed without raising an exception)
3. Permit by type (don't ask about future errors of this type)
4. Permit by line (don't ask about future errors raised from this point)
5. Backtrace (show the call stack leading up to the error)
6. Debug (start a debugger)
7. Console (start an IRB session)
What now?
6
lib/ruby/gems/1.8/gems/hammertime-0.0.1/lib/hammertime.rb:83
false
(rdb:1) list
[78, 87] in lib/ruby/gems/1.8/gems/hammertime-0.0.1/lib/hammertime.rb
78 backtrace.each do |frame| c.say frame end
79 false
80 end
81 menu.choice "Debug (start a debugger)" do
82 debugger
=> 83 false
84 end
85 menu.choice "Console (start an IRB session)" do
86 require 'irb'
87 IRB.start
(rdb:1) up
#1 HighLine.choose(items#Array)
at line lib/ruby/gems/1.8/gems/highline-1.5.1/lib/highline.rb:318
(rdb:1) up
#2 Hammertime.hammertime_raise(args#Array)
at line lib/ruby/gems/1.8/gems/hammertime-0.0.1/lib/hammertime.rb:91
(rdb:1) up
#3 Hammertime.raise(args#Array)
at line lib/ruby/gems/1.8/gems/hammertime-0.0.1/lib/hammertime.rb:106
(rdb:1) up
#4 Object.faulty_method at line example.rb:6
(rdb:1) list
[1, 10] in example.rb
1 require 'hammertime'
2
3 $broken = true
4
5 def faulty_method
=> 6 raise "Oh no!" if $broken
7 end
8
9 3.times do |n|
10 puts "Attempt (#{n+1}/3)"
(rdb:1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment