Error#to_s should ensure that the value returned is a string.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30455 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
68f8df9e15
commit
89d6841175
3
error.c
3
error.c
@ -524,8 +524,7 @@ exc_to_s(VALUE exc)
|
|||||||
VALUE mesg = rb_attr_get(exc, rb_intern("mesg"));
|
VALUE mesg = rb_attr_get(exc, rb_intern("mesg"));
|
||||||
|
|
||||||
if (NIL_P(mesg)) return rb_class_name(CLASS_OF(exc));
|
if (NIL_P(mesg)) return rb_class_name(CLASS_OF(exc));
|
||||||
OBJ_INFECT(mesg, exc);
|
return rb_String(mesg);
|
||||||
return mesg;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user