Project

General

Profile

Actions

Feature #11650

closed

Add custom error message arg to Timeout.timeout

Added by kirs (Kir Shatrov) over 6 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
[ruby-core:71312]

Description

Now Timeout.timeout can accept custom error message:

Timeout.timeout(30, CustomException, custom_message)

This option might be useful for networking:

# net/smtp.rb#do_start
Timeout.timeout(30, Net::OpenTimeout, "failed to open #{host}") do
  tcp_connection
end

Files

feature.diff (1.66 KB) feature.diff kirs (Kir Shatrov), 11/03/2015 10:26 AM
Actions

Also available in: Atom PDF