JoshCheek / seeing_is_believing

Displays the results of every line of code in your file
1.3k stars 54 forks source link

You can have more than one exception with fork #85

Closed JoshCheek closed 7 years ago

JoshCheek commented 7 years ago

The result object only has a spot for one exception, but you can have more than one if you fork. Eg there should be errors reported on both branches of the if statement here:

begin
  if fork                          # => 18920, nil
    raise 'some irrelevant error'
  else
    Queue.new.shift                # ~> fatal: No live threads left. Deadlock?
  end
ensure
  $!.class.name == 'fatal'         # => false, true
  $!.message =~ /deadlock/i        # => nil,   22
end