diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2019-05-02 23:05:13 +0900 |
|---|---|---|
| committer | GitHub <[email protected]> | 2019-05-02 23:05:13 +0900 |
| commit | 8c8e6e25ad57e960e1311de24a4059f8b6955625 (patch) | |
| tree | 72c475ed719649c1e1eb26d7408ff3e26ba8a7b5 /src | |
| parent | 35319bed01d58c785f73ce03e67d4e58be30f4b5 (diff) | |
| parent | 95a92d35c89ec9c39c97c5f948255389a129029e (diff) | |
| download | mruby-8c8e6e25ad57e960e1311de24a4059f8b6955625.tar.gz mruby-8c8e6e25ad57e960e1311de24a4059f8b6955625.zip | |
Merge pull request #4417 from shuujii/unify-overflow-error-class-for-conversion-to-integer-to-RangeError
Unify overflow error class for conversion to integer to `RangeError`
Diffstat (limited to 'src')
| -rw-r--r-- | src/numeric.c | 2 | ||||
| -rw-r--r-- | src/string.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/numeric.c b/src/numeric.c index 8205e41f6..101b338de 100644 --- a/src/numeric.c +++ b/src/numeric.c @@ -1230,7 +1230,7 @@ mrb_flo_to_fixnum(mrb_state *mrb, mrb_value x) z = (mrb_int)d; } else { - mrb_raisef(mrb, E_ARGUMENT_ERROR, "number (%S) too big for integer", x); + mrb_raisef(mrb, E_RANGE_ERROR, "number (%S) too big for integer", x); } } return mrb_fixnum_value(z); diff --git a/src/string.c b/src/string.c index 90e609992..f043bfd5a 100644 --- a/src/string.c +++ b/src/string.c @@ -2112,7 +2112,7 @@ mrb_str_len_to_inum(mrb_state *mrb, const char *str, mrb_int len, mrb_int base, else #endif { - mrb_raisef(mrb, E_ARGUMENT_ERROR, "string (%S) too big for integer", + mrb_raisef(mrb, E_RANGE_ERROR, "string (%S) too big for integer", mrb_str_new(mrb, str, pend-str)); } } |
