Actions
Bug #2048
closedThread#raise: Handling of Current Exception
Bug #2048:
Thread#raise: Handling of Current Exception
Description
=begin
$ cat /tmp/thread.rb
t = Thread.new do
begin
1/0
rescue ZeroDivisionError
sleep 3
end
end
Thread.pass while t.status and t.status != "sleep"
t.raise
t.value
t.kill
$ ruby -v /tmp/thread.rb
ruby 1.9.2dev (2009-09-03 trunk 24741) [i686-linux]
/tmp/thread.rb:5:in sleep': unhandled exception from /tmp/thread.rb:5:in
rescue in block in '
from /tmp/thread.rb:2:in `block in '
$ ruby8 -v /tmp/thread.rb
ruby 1.8.8dev (2009-09-04) [i686-linux]
/tmp/thread.rb:3:in /': divided by 0 (ZeroDivisionError) from /tmp/thread.rb:11:in
value'
from /tmp/thread.rb:11
On 1.8 Thread#raise re-raises the current exception; on 1.9 it doesn't.
=end
Actions