Commit e407022b authored by Akira Yumiyama's avatar Akira Yumiyama

change the error message (NoMethodError, NameError)

parent 559933f5
......@@ -852,7 +852,9 @@ mrb_method_search(mrb_state *mrb, struct RClass* c, mrb_sym mid)
m = mrb_method_search_vm(mrb, &c, mid);
if (!m) {
mrb_raisef(mrb, E_NOMETHOD_ERROR, "no method named %s\n", mrb_sym2name(mrb, mid));
mrb_raisef(mrb, E_NAME_ERROR, "undefined method '%s' for class %s",
mrb_sym2name(mrb, mid),
RSTRING_PTR(mrb_funcall(mrb, mrb_obj_value(c), "inspect", 0)));
}
return m;
}
......@@ -1008,7 +1010,9 @@ mrb_bob_missing(mrb_state *mrb, mrb_value mod)
if (!SYMBOL_P(name)) {
mrb_raise(mrb, E_TYPE_ERROR, "name should be a symbol");
}
mrb_raisef(mrb, E_NOMETHOD_ERROR, "no method named %s", mrb_sym2name(mrb, mrb_symbol(name)));
mrb_raisef(mrb, E_NOMETHOD_ERROR, "undefined method '%s' for %s",
mrb_sym2name(mrb, mrb_symbol(name)),
RSTRING_PTR(mrb_funcall(mrb, mod, "inspect", 0)));
/* not reached */
return mrb_nil_value();
}
......
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