diff options
Diffstat (limited to 'error.c')
-rw-r--r-- | error.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -522,9 +522,12 @@ static VALUE exc_to_s(VALUE exc) { VALUE mesg = rb_attr_get(exc, rb_intern("mesg")); + VALUE r = Qnil; 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; } /* |