Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't seem to work with threads #59

Open
seren opened this issue Feb 8, 2014 · 0 comments
Open

Doesn't seem to work with threads #59

seren opened this issue Feb 8, 2014 · 0 comments

Comments

@seren
Copy link

seren commented Feb 8, 2014

Everything works well normally, however when an exception occurs within a thread, the Thread exits silently rather than dropping into pry.

require 'pry-rescue'
require 'pry'

# Test 1. Pry-rescue works.
0/0

# Test 2. Pry-rescue doesn't drop into pry.
Thread.new do
  puts "1st crash thread starting: #{Thread.current}"
  0/0
  puts "1st crash thread finishing: #{Thread.current}"
end

# Test 3. Binding.pry does drop into pry.
Thread.new do
  puts "2nd crash thread starting: #{Thread.current}"
  begin
    0/0
  rescue => e
    binding.pry
  end
  puts "2nd crash thread finishing: #{Thread.current}"
end

sleep 1 until Thread.list.count < 2
puts "main thread finishing"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant