[ruby-core:125833] [Ruby Bug#22129] error_highlight raises NotImplementedError for ArgumentErrors that get wrapped
Issue #22129 has been reported by rwstauner (Randy Stauner). ---------------------------------------- Bug #22129: error_highlight raises NotImplementedError for ArgumentErrors that get wrapped https://bugs.ruby-lang.org/issues/22129 * Author: rwstauner (Randy Stauner) * Status: Open * Backport: 3.3: DONTNEED, 3.4: DONTNEED, 4.0: REQUIRED ---------------------------------------- With code like ```ruby def x(y:) = y begin x rescue => e p e.exception("wat").detailed_message end ``` a NotImplementedError is raised on ruby 4.0+ ```/Users/rwstauner/.rubies/4.0.2/lib/ruby/4.0.0/error_highlight/base.rb:297:in 'ErrorHighlight::Spotter#spot': NotImplementedError (NotImplementedError) from /Users/rwstauner/.rubies/4.0.2/lib/ruby/4.0.0/error_highlight/base.rb:68:in 'ErrorHighlight.spot' from /Users/rwstauner/.rubies/4.0.2/lib/ruby/4.0.0/error_highlight/core_ext.rb:34:in 'ErrorHighlight::CoreExt#generate_snippet' from /Users/rwstauner/.rubies/4.0.2/lib/ruby/4.0.0/error_highlight/core_ext.rb:43:in 'ErrorHighlight::CoreExt#detailed_message' from tiny.rb:6:in 'Exception#full_message' from tiny.rb:6:in '<main>' tiny.rb:1:in 'Object#x': missing keyword: :y (ArgumentError) caller: tiny.rb:4 | x ^ callee: tiny.rb:1 | def x(y:) = y ^ from tiny.rb:4:in '<main>' ``` on ruby 3.4 it did not raise: ``` tiny.rb:1:in 'x': wat (ArgumentError) from tiny.rb:4:in '<main>' ``` seems related to https://bugs.ruby-lang.org/issues/21543 I have a PR up at https://github.com/ruby/error_highlight/pull/78 -- https://bugs.ruby-lang.org/
Issue #22129 has been updated by mame (Yusuke Endoh). Status changed from Assigned to Closed Merged, thank you! ---------------------------------------- Bug #22129: error_highlight raises NotImplementedError for ArgumentErrors that get wrapped https://bugs.ruby-lang.org/issues/22129#change-117756 * Author: rwstauner (Randy Stauner) * Status: Closed * Assignee: mame (Yusuke Endoh) * Backport: 3.3: DONTNEED, 3.4: DONTNEED, 4.0: REQUIRED ---------------------------------------- With code like ```ruby def x(y:) = y begin x rescue => e p e.exception("wat").detailed_message end ``` a NotImplementedError is raised on ruby 4.0+ ``` /Users/rwstauner/.rubies/4.0.2/lib/ruby/4.0.0/error_highlight/base.rb:297:in 'ErrorHighlight::Spotter#spot': NotImplementedError (NotImplementedError) from /Users/rwstauner/.rubies/4.0.2/lib/ruby/4.0.0/error_highlight/base.rb:68:in 'ErrorHighlight.spot' from /Users/rwstauner/.rubies/4.0.2/lib/ruby/4.0.0/error_highlight/core_ext.rb:34:in 'ErrorHighlight::CoreExt#generate_snippet' from /Users/rwstauner/.rubies/4.0.2/lib/ruby/4.0.0/error_highlight/core_ext.rb:43:in 'ErrorHighlight::CoreExt#detailed_message' from tiny.rb:6:in 'Exception#full_message' from tiny.rb:6:in '<main>' tiny.rb:1:in 'Object#x': missing keyword: :y (ArgumentError) caller: tiny.rb:4 | x ^ callee: tiny.rb:1 | def x(y:) = y ^ from tiny.rb:4:in '<main>' ``` on ruby 3.4 it did not raise: ``` tiny.rb:1:in 'x': wat (ArgumentError) from tiny.rb:4:in '<main>' ``` seems related to https://bugs.ruby-lang.org/issues/21543 I have a PR up at https://github.com/ruby/error_highlight/pull/78 -- https://bugs.ruby-lang.org/
Issue #22129 has been updated by rwstauner (Randy Stauner). Backport PR for 4.0: https://github.com/ruby/ruby/pull/17480 ---------------------------------------- Bug #22129: error_highlight raises NotImplementedError for ArgumentErrors that get wrapped https://bugs.ruby-lang.org/issues/22129#change-117757 * Author: rwstauner (Randy Stauner) * Status: Closed * Assignee: mame (Yusuke Endoh) * Backport: 3.3: DONTNEED, 3.4: DONTNEED, 4.0: REQUIRED ---------------------------------------- With code like ```ruby def x(y:) = y begin x rescue => e p e.exception("wat").detailed_message end ``` a NotImplementedError is raised on ruby 4.0+ ``` /Users/rwstauner/.rubies/4.0.2/lib/ruby/4.0.0/error_highlight/base.rb:297:in 'ErrorHighlight::Spotter#spot': NotImplementedError (NotImplementedError) from /Users/rwstauner/.rubies/4.0.2/lib/ruby/4.0.0/error_highlight/base.rb:68:in 'ErrorHighlight.spot' from /Users/rwstauner/.rubies/4.0.2/lib/ruby/4.0.0/error_highlight/core_ext.rb:34:in 'ErrorHighlight::CoreExt#generate_snippet' from /Users/rwstauner/.rubies/4.0.2/lib/ruby/4.0.0/error_highlight/core_ext.rb:43:in 'ErrorHighlight::CoreExt#detailed_message' from tiny.rb:6:in 'Exception#full_message' from tiny.rb:6:in '<main>' tiny.rb:1:in 'Object#x': missing keyword: :y (ArgumentError) caller: tiny.rb:4 | x ^ callee: tiny.rb:1 | def x(y:) = y ^ from tiny.rb:4:in '<main>' ``` on ruby 3.4 it did not raise: ``` tiny.rb:1:in 'x': wat (ArgumentError) from tiny.rb:4:in '<main>' ``` seems related to https://bugs.ruby-lang.org/issues/21543 I have a PR up at https://github.com/ruby/error_highlight/pull/78 -- https://bugs.ruby-lang.org/
participants (2)
-
mame (Yusuke Endoh) -
rwstauner (Randy Stauner)