Skip to content

Commit

Permalink
Let Exception#full_message pass highlight keywords to #detailed_message
Browse files Browse the repository at this point in the history
.. even when the argument is not explicitly passed.
  • Loading branch information
mame committed Feb 22, 2022
1 parent 89e4466 commit 4db9864
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions error.c
Expand Up @@ -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);
Expand Down

0 comments on commit 4db9864

Please sign in to comment.