Issue #19117 has been updated by Eregon (Benoit Daloze).
I'm in favor to keep it removed, because these are implementation details.
Although ideally in backtraces I think it would be best to hide the entry corresponding to
`rescue in`/`ensure in`, i.e., instead of:
```
/tmp/foo.rb:7:in `rescue in rescue in raise_nested_exceptions': Third error
(RuntimeError)
from /tmp/foo.rb:4:in `rescue in raise_nested_exceptions'
from /tmp/foo.rb:1:in `raise_nested_exceptions'
from /tmp/foo.rb:11:in `<main>'
```
have:
```
/tmp/foo.rb:7:in 'Object#raise_nested_exceptions': Third error (RuntimeError)
from /tmp/foo.rb:11:in '<main>'
```
Since there are no calls from Ruby semantics POV and the extra frames are a CRuby
implementation detail (e.g. TruffleRuby does not have extra call frames for `rescue` and
`ensure`, not sure about JRuby).
----------------------------------------
Feature #19117: Include the method owner in backtraces, not just the method name
https://bugs.ruby-lang.org/issues/19117#change-106830
* Author: byroot (Jean Boussier)
* Status: Closed
* Priority: Normal
* Target version: 3.4
----------------------------------------
```
module Foo
class Bar
def inspect
1 + '1'
end
end
end
p Foo::Bar.new
```
This code produce the following backtrace:
```
/tmp/foo.rb:4:in `+': String can't be coerced into Integer (TypeError)
from /tmp/foo.rb:4:in `inspect'
from /tmp/foo.rb:9:in `p'
from /tmp/foo.rb:9:in `<main>'
```
This works, but on large codebases and large backtraces the method name isn't always
all that revealing, most of the time you need to open many of the locations listed in the
backtrace to really understand what is going on.
I propose that we also include the owner name:
```
/tmp/foo.rb:4:in `Integer#+': String can't be coerced into Integer (TypeError)
from /tmp/foo.rb:4:in `Foo::Bar#inspect'
from /tmp/foo.rb:9:in `Kernel#p'
from /tmp/foo.rb:9:in `<main>'
```
I believe that in many case it would allow to much better understand the backtrace without
having to jump back and forth between it and the source code.
This is inspired by @ivoanjo 's `backtracie` gem:
https://github.com/ivoanjo/backtracie
--
https://bugs.ruby-lang.org/