Skip to content

Instantly share code, notes, and snippets.

@morhekil
Created May 19, 2013 01:38
Show Gist options
  • Save morhekil/5606324 to your computer and use it in GitHub Desktop.
Save morhekil/5606324 to your computer and use it in GitHub Desktop.
Ruby - exception in the forked process
child = fork do
raise RuntimeError, "testing child exception"
end
pid, status = Process.wait2 child
puts status.inspect
% ruby exception.rb
exception.rb:2:in `block in <main>': testing child exception (RuntimeError)
from rubytest.rb:1:in `fork'
from rubytest.rb:1:in `<main>'
#<Process::Status: pid 57654 exit 1>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment