summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/eval.c b/eval.c
index 6102cfdc86..a70a7a9cb8 100644
--- a/eval.c
+++ b/eval.c
@@ -511,9 +511,12 @@ setup_exception(rb_thread_t *th, int tag, volatile VALUE mesg, VALUE cause)
!rb_obj_is_kind_of(e, rb_eSystemExit)) {
int status;
+ mesg = e;
PUSH_TAG();
if ((status = EXEC_TAG()) == 0) {
+ th->errinfo = Qnil;
e = rb_obj_as_string(e);
+ th->errinfo = mesg;
if (file && line) {
warn_printf("Exception `%s' at %s:%d - %"PRIsVALUE"\n",
rb_obj_classname(th->errinfo), file, line, e);