aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authortomoya ishida <tomoyapenguin@gmail.com>2023-11-24 02:33:08 +0900
committergit <svn-admin@ruby-lang.org>2023-11-23 17:33:13 +0000
commit11d7c75fb33138e9ecadcf222286897826aa0a36 (patch)
treebc31d98132534a2c618e249e76d8d9ad738c83cf /lib
parentecdb11288113b5e8b907530512af449f3ffc6c07 (diff)
downloadruby-11d7c75fb33138e9ecadcf222286897826aa0a36.tar.gz
[ruby/irb] Handle handle_exception's exception
(https://github.com/ruby/irb/pull/780) https://github.com/ruby/irb/commit/d42138c477
Diffstat (limited to 'lib')
-rw-r--r--lib/irb.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/irb.rb b/lib/irb.rb
index 655abaf069..7547654257 100644
--- a/lib/irb.rb
+++ b/lib/irb.rb
@@ -743,7 +743,14 @@ module IRB
message = message.gsub(/\(irb\):(?<num>\d+):in `<(?<frame>top \(required\))>'/) { "(irb):#{$~[:num]}:in `<main>'" }
puts message
end
- print "Maybe IRB bug!\n" if irb_bug
+ puts 'Maybe IRB bug!' if irb_bug
+ rescue Exception => handler_exc
+ begin
+ puts exc.inspect
+ puts "backtraces are hidden because #{handler_exc} was raised when processing them"
+ rescue Exception
+ puts 'Uninspectable exception occurred'
+ end
end
# Evaluates the given block using the given +path+ as the Context#irb_path