Let Exception#full_message pass highlight keywords to #detailed_message

.. even when the argument is not explicitly passed.
This commit is contained in:
Yusuke Endoh 2022-02-02 15:36:13 +09:00
parent 89e446683e
commit 4db986431a
Notes: git 2022-02-22 11:56:15 +09:00

View File

@ -1350,6 +1350,13 @@ exc_full_message(int argc, VALUE *argv, VALUE exc)
highlight = check_highlight_keyword(opt, 1);
order = check_order_keyword(opt);
{
static VALUE kw_highlight;
if (!kw_highlight) kw_highlight = ID2SYM(rb_intern_const("highlight"));
if (NIL_P(opt)) opt = rb_hash_new();
rb_hash_aset(opt, kw_highlight, highlight);
}
str = rb_str_new2("");
errat = rb_get_backtrace(exc);
emesg = rb_get_detailed_message(exc, opt);