Commit 95a92d35 authored by KOBAYASHI Shuji's avatar KOBAYASHI Shuji

Unify overflow error class for conversion to integer to `RangeError`

parent eeb78a72
......@@ -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);
......
......@@ -2115,7 +2115,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