Skip to content

Commit 80d2878

Browse files
st0012matzbot
authored andcommitted
[ruby/irb] Print more actionable message when the exception may be
an IRB issue (ruby/irb#1061) ruby/irb@4d74d39261
1 parent 1b30370 commit 80d2878

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/irb.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,10 @@ def handle_exception(exc)
426426
# The "<top (required)>" in "(irb)" may be the top level of IRB so imitate the main object.
427427
message = message.gsub(/\(irb\):(?<num>\d+):in (?<open_quote>[`'])<(?<frame>top \(required\))>'/) { "(irb):#{$~[:num]}:in #{$~[:open_quote]}<main>'" }
428428
puts message
429-
puts 'Maybe IRB bug!' if irb_bug
429+
430+
if irb_bug
431+
puts "This may be an issue with IRB. If you believe this is an unexpected behavior, please report it to https://github.com/ruby/irb/issues"
432+
end
430433
rescue Exception => handler_exc
431434
begin
432435
puts exc.inspect

0 commit comments

Comments
 (0)