Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions lib/timeout.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,15 @@ def exception(*)
# Raised by Timeout.timeout when the block times out.
class Error < RuntimeError
def self.handle_timeout(message)
exc = ExitException.new(message)

begin
yield exc
yield ExitException
rescue ExitException => e
raise new(message) if exc.equal?(e)
raise
case e
when ExitException
raise new(message)
else
raise
end
end
end
end
Expand Down