From: me@... Date: 2018-12-24T07:07:54+00:00 Subject: [ruby-core:90693] [CommonRuby Feature#15458] Automatic Exception#cause print in IRB Issue #15458 has been reported by jnchito (Junichi Ito). ---------------------------------------- Feature #15458: Automatic Exception#cause print in IRB https://bugs.ruby-lang.org/issues/15458 * Author: jnchito (Junichi Ito) * Status: Open * Priority: Normal * Assignee: * Target version: ---------------------------------------- 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/ Unsubscribe: