From: "Earlopain (Earlopain _) via ruby-core" Date: 2026-08-16T14:11:54+00:00 Subject: [ruby-core:126424] [Ruby Feature#15458] Automatic Exception#cause print in IRB Issue #15458 has been updated by Earlopain (Earlopain _). Status changed from Open to Closed IRB does exactly this now ---------------------------------------- Feature #15458: Automatic Exception#cause print in IRB https://bugs.ruby-lang.org/issues/15458#change-118569 * Author: jnchito (Junichi Ito) * Status: Closed ---------------------------------------- According to Ruby 2.6 NEWS, the following feature will be added: > Print cause of the exception if the exception is not caught and printed its backtraces and error message [Feature #8257] I expected it would be applied in IRB too, but it wasn't. Here is my example: ~~~ > begin > 1/0 > rescue => e > e.mesage > end Traceback (most recent call last): 5: from /Users/jnito/.rbenv/versions/2.6.0-rc1/bin/irb:23:in `
' 4: from /Users/jnito/.rbenv/versions/2.6.0-rc1/bin/irb:23:in `load' 3: from /Users/jnito/.rbenv/versions/2.6.0-rc1/lib/ruby/gems/2.6.0/gems/irb-0.9.6/exe/irb:11:in `' 2: from (irb):1 1: from (irb):4:in `rescue in irb_binding' NoMethodError (undefined method `mesage' for #) Did you mean? message ~~~ On the other hand, when I run that code via ruby command, cause of the exception is automatically printed: ~~~ $ ruby sample.rb Traceback (most recent call last): 1: from sample.rb:2:in `
' sample.rb:2:in `/': divided by 0 (ZeroDivisionError) 1: from sample.rb:1:in `
' sample.rb:4:in `rescue in
': undefined method `mesage' for # (NoMethodError) Did you mean? message ~~~ I feel it would be more natural and useful if the new feature would work in IRB too. -- https://bugs.ruby-lang.org/ ______________________________________________ ruby-core mailing list -- ruby-core@ml.ruby-lang.org To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/