From aae400a72513349f62b2d1c172844dae6e5e8294 Mon Sep 17 00:00:00 2001 From: Stan Lo Date: Fri, 10 Jan 2025 22:01:57 +0000 Subject: [PATCH] Print more actionable message when the exception may be an IRB issue --- lib/irb.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/irb.rb b/lib/irb.rb index 29be6386c..80cfa6cd8 100644 --- a/lib/irb.rb +++ b/lib/irb.rb @@ -426,7 +426,10 @@ def handle_exception(exc) # The "" in "(irb)" may be the top level of IRB so imitate the main object. message = message.gsub(/\(irb\):(?\d+):in (?[`'])<(?top \(required\))>'/) { "(irb):#{$~[:num]}:in #{$~[:open_quote]}
'" } puts message - puts 'Maybe IRB bug!' if irb_bug + + if irb_bug + 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" + end rescue Exception => handler_exc begin puts exc.inspect