mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Exception#to_s should actually call to_s.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30531 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
b404cbac77
commit
36a0e432f2
2 changed files with 8 additions and 1 deletions
|
|
@ -1,3 +1,7 @@
|
||||||
|
Thu Jan 13 06:27:29 2011 Ryan Davis <ryand-ruby@zenspider.com>
|
||||||
|
|
||||||
|
* error.c: Exception#to_s should actually call to_s.
|
||||||
|
|
||||||
Thu Jan 13 00:32:54 2011 NARUSE, Yui <naruse@ruby-lang.org>
|
Thu Jan 13 00:32:54 2011 NARUSE, Yui <naruse@ruby-lang.org>
|
||||||
|
|
||||||
* addr2line.c (get_nth_dirname): decrement the directory index
|
* addr2line.c (get_nth_dirname): decrement the directory index
|
||||||
|
|
|
||||||
5
error.c
5
error.c
|
|
@ -522,9 +522,12 @@ static VALUE
|
||||||
exc_to_s(VALUE exc)
|
exc_to_s(VALUE exc)
|
||||||
{
|
{
|
||||||
VALUE mesg = rb_attr_get(exc, rb_intern("mesg"));
|
VALUE mesg = rb_attr_get(exc, rb_intern("mesg"));
|
||||||
|
VALUE r = Qnil;
|
||||||
|
|
||||||
if (NIL_P(mesg)) return rb_class_name(CLASS_OF(exc));
|
if (NIL_P(mesg)) return rb_class_name(CLASS_OF(exc));
|
||||||
return rb_String(mesg);
|
r = rb_String(mesg);
|
||||||
|
OBJ_INFECT(r, exc);
|
||||||
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue