ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
From: matz@ruby-lang.org
To: ruby-core@ruby-lang.org
Subject: [ruby-core:77194] [Ruby trunk Feature#11650] Add custom error message arg to Timeout.timeout
Date: Wed, 07 Sep 2016 08:03:02 +0000	[thread overview]
Message-ID: <redmine.journal-60409.20160907080302.0d30293c421bb637@ruby-lang.org> (raw)
In-Reply-To: redmine.issue-11650.20151103102742@ruby-lang.org

Issue #11650 has been updated by Yukihiro Matsumoto.


Accepted.

Matz.


----------------------------------------
Feature #11650: Add custom error message arg to Timeout.timeout
https://bugs.ruby-lang.org/issues/11650#change-60409

* Author: Kir Shatrov
* Status: Open
* Priority: Normal
* Assignee: 
----------------------------------------
Now Timeout.timeout can accept custom error message:

~~~ruby
Timeout.timeout(30, CustomException, “custom_message”)
~~~

This option might be useful for networking:

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

---Files--------------------------------
feature.diff (1.66 KB)


-- 
https://bugs.ruby-lang.org/

      parent reply	other threads:[~2016-09-07  7:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <redmine.issue-11650.20151103102742@ruby-lang.org>
2015-11-03 10:27 ` [ruby-core:71312] [Ruby trunk - Feature #11650] [Open] Add custom error message arg to Timeout.timeout shatrov
2015-11-03 12:42 ` [ruby-core:71314] [Ruby trunk - Feature #11650] " nobu
2016-09-07  8:03 ` matz [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.ruby-lang.org/en/community/mailing-lists/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=redmine.journal-60409.20160907080302.0d30293c421bb637@ruby-lang.org \
    --to=ruby-core@ruby-lang.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).