Project

General

Profile

Feature #11650

Add custom error message arg to Timeout.timeout

Added by kirs (Kir Shatrov) over 3 years ago. Updated over 2 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

Associated revisions

Revision 047ca4ba
Added by nobu (Nobuyoshi Nakada) over 2 years ago

timeout.rb: custom error message

  • lib/timeout.rb (Timeout#timeout): add custom error message argument. [Feature #11650]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56089 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 56089
Added by nobu (Nobuyoshi Nakada) over 2 years ago

timeout.rb: custom error message

  • lib/timeout.rb (Timeout#timeout): add custom error message argument. [Feature #11650]

Revision 56089
Added by nobu (Nobuyoshi Nakada) over 2 years ago

timeout.rb: custom error message

  • lib/timeout.rb (Timeout#timeout): add custom error message argument. [Feature #11650]

Revision 56089
Added by nobu (Nobuyoshi Nakada) over 2 years ago

timeout.rb: custom error message

  • lib/timeout.rb (Timeout#timeout): add custom error message argument. [Feature #11650]

Revision 56089
Added by nobu (Nobuyoshi Nakada) over 2 years ago

timeout.rb: custom error message

  • lib/timeout.rb (Timeout#timeout): add custom error message argument. [Feature #11650]

History

Updated by nobu (Nobuyoshi Nakada) over 3 years ago

  • Description updated (diff)

Sounds reasonable.

#3

Updated by nobu (Nobuyoshi Nakada) over 2 years ago

  • Status changed from Open to Closed

Applied in changeset r56089.


timeout.rb: custom error message

  • lib/timeout.rb (Timeout#timeout): add custom error message argument. [Feature #11650]

Also available in: Atom PDF