Project

General

Profile

Bug #15420

Kernel#sleep などに負数を渡したときのエラーメッセージ

Added by shuujii (Shuji KOBAYASHI) over 1 year ago. Updated over 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
ruby -v:
ruby 2.6.0rc2 (2018-12-15 trunk 66408) [x86_64-linux]
[ruby-dev:50709]

Description

sleep に負数を渡した場合のエラーメッセージは以下のようになります。

$ ruby -e 'sleep(-1)'
Traceback (most recent call last):
    1: from -e:1:in `<main>'
-e:1:in `sleep': time interval must be positive (ArgumentError)

しかし、0 は許容されているので "must not be negative" などのほうが良いと思います。


Files

fix-negative-time-interval-message.patch (1.94 KB) fix-negative-time-interval-message.patch shuujii (Shuji KOBAYASHI), 12/16/2018 05:22 AM
#1

Updated by nobu (Nobuyoshi Nakada) over 1 year ago

  • Status changed from Open to Closed

Applied in changeset trunk|r66418.


Refine error message for time interval

  • time.c (time_timespec): Time interval value can be zero, not only positive. [ruby-dev:50709] [Bug #15420]

From: shuujii (Shuji KOBAYASHI) shuujii@gmail.com

Also available in: Atom PDF