Skip to content

Commit 4d74d39

Browse files
authored
Print more actionable message when the exception may be an IRB issue (#1061)
1 parent 9fc14eb commit 4d74d39

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

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)