Unverified Commit 8c8e6e25 authored by Yukihiro "Matz" Matsumoto's avatar Yukihiro "Matz" Matsumoto Committed by GitHub

Merge pull request #4417 from...

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`
parents 35319bed 95a92d35
......@@ -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);
......
......@@ -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));
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment