O
oliver
Define following class:
class MyThread < Thread
def initialize()
super{
puts "started"
sleep 1000
}
end
def test_raise()
raise StandardError.new()
puts "hello"
end
end
Open irb and run:
irb(main):082:0> thread = MyThread.new
started=> #<MyThread:0xb7cec234 run>
irb(main):093:0> thread.test_raise
hello
=> nil
I think the line "puts "hello"" should not be run after raising an
exception.
What is the reason of this problem?
Thanks.
class MyThread < Thread
def initialize()
super{
puts "started"
sleep 1000
}
end
def test_raise()
raise StandardError.new()
puts "hello"
end
end
Open irb and run:
irb(main):082:0> thread = MyThread.new
started=> #<MyThread:0xb7cec234 run>
irb(main):093:0> thread.test_raise
hello
=> nil
I think the line "puts "hello"" should not be run after raising an
exception.
What is the reason of this problem?
Thanks.