Closed zw963 closed 2 years ago
+1
Isn't your example missing wrapping the test call with Pry.rescue
?
e.g.
Frame number: 0/0
From: /home/jason/Code/scratch/pry-rescue-test.rb:10 :
5: raise 'foo'
6: rescue => e
7: raise 'bar'
8: end
9:
=> 10: binding.pry
[1] pry(main)> Pry.rescue { test }
Frame number: 0/18
Frame type: rescue
From: /home/jason/Code/scratch/pry-rescue-test.rb:7 Object#test:
4: def test
5: raise 'foo'
6: rescue => e
=> 7: raise 'bar'
8: end
RuntimeError: bar
from pry-rescue-test.rb:7:in `rescue in test'
Caused by RuntimeError: foo
from pry-rescue-test.rb:5:in `test'
[1] pry(main)> try-again
Frame number: 0/18
Frame type: rescue
From: /home/jason/Code/scratch/pry-rescue-test.rb:7 Object#test:
4: def test
5: raise 'foo'
6: rescue => e
=> 7: raise 'bar'
8: end
RuntimeError: bar
from pry-rescue-test.rb:7:in `rescue in test'
Caused by RuntimeError: foo
from pry-rescue-test.rb:5:in `test'
[1] pry(main)>
Yes, you are right, thank you.
Following is code example:
Following is my gem version:
Following is reproduce:
Tested on both 2.7.1 and 3.0.0, thank you.