Project

General

Profile

Actions

Bug #15420

closed

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

Added by shuujii (Shuji KOBAYASHI) over 3 years ago. Updated over 3 years 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
Actions #1

Updated by nobu (Nobuyoshi Nakada) over 3 years ago

  • Status changed from Open to Closed

Applied in changeset trunk|r66418.


Refine error message for time interval

From: shuujii (Shuji KOBAYASHI)

Actions

Also available in: Atom PDF