From 333c364d5fccf22696a6edb67f45117c81e82009 Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Sun, 4 May 2025 22:41:19 +0900 Subject: [PATCH] error.c (mrb_exc_inspect): Update format to match CRuby --- src/error.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/error.c b/src/error.c index 1c7fa9370..b6bf32159 100644 --- a/src/error.c +++ b/src/error.c @@ -137,7 +137,7 @@ mrb_exc_inspect(mrb_state *mrb, mrb_value exc) { mrb_value cname = mrb_mod_to_s(mrb, mrb_obj_value(mrb_obj_class(mrb, exc))); mrb_value mesg = mrb_exc_mesg_get(mrb, mrb_exc_ptr(exc)); /* string or nil */ - return (mrb_nil_p(mesg)||RSTRING_LEN(mesg)==0) ? cname : mrb_format(mrb, "%v (%v)", mesg, cname); + return (mrb_nil_p(mesg)||RSTRING_LEN(mesg)==0) ? cname : mrb_format(mrb, "#<%v: %v>", cname, mesg); } void mrb_keep_backtrace(mrb_state *mrb, mrb_value exc);