Project

General

Profile

Actions

Bug #8730

closed

"rescue Exception" rescues Timeout::ExitException

Added by takiuchi (Genki Takiuchi) over 11 years ago. Updated about 11 years ago.

Status:
Rejected
Assignee:
-
Target version:
ruby -v:
2.0.0
[ruby-core:<unknown>]

Description

=begin
Timeout.timeout ブロック内で rescue Exception によって例外を捕捉している箇所があると、
タイムアウト処理が内部的に利用している Timeout::ExitException クラスの無名派生クラスを補足してしまい、
正しく Timeout::Error が発生しない。

例)

timeout 1 do
begin
sleep 3
rescue Exception => e
puts e.class.superclass #=> "Timeout::ExitException"
end
end
=end


Related issues 2 (0 open2 closed)

Related to Ruby master - Misc #19740: Block taking methods can't differentiate between a non-local return and a throwClosedActions
Has duplicate Ruby master - Bug #8845: Timeout::ExitException が意図せずに rescue される事があるRejected08/31/2013Actions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0