Skip to content

Commit 1506c48

Browse files
committed
Update NEWS.md for improvements of error backtrace
1 parent 38310fe commit 1506c48

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

NEWS.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,24 @@ Note: We're only listing outstanding class updates.
9898
`Binding#implicit_parameter_defined?` have been added to access
9999
numbered parameters and "it" parameter. [[Bug #21049]]
100100
101+
* ErrorHighlight
102+
103+
* When an ArgumentError is raised, it now displays code snippets for
104+
both the method call (caller) and the method definition (callee).
105+
[[Feature #21543]]
106+
107+
```
108+
test.rb:1:in 'Object#add': wrong number of arguments (given 1, expected 2) (ArgumentError)
109+
110+
caller: test.rb:3
111+
| add(1)
112+
^^^
113+
callee: test.rb:1
114+
| def add(x, y) = x + y
115+
^^^
116+
from test.rb:3:in '<main>'
117+
```
118+
101119
* File
102120
103121
* `File::Stat#birthtime` is now available on Linux via the statx
@@ -347,6 +365,31 @@ The following bundled gems are updated.
347365
and was already deprecated,.
348366
[[Feature #20971]]
349367

368+
* A backtrace for `ArgumentError` of "wrong number of arguments" now
369+
include the receiver's class or module name (e.g., in `Foo#bar`
370+
instead of in `bar`). [[Bug #21698]]
371+
372+
* Backtraces no longer display `internal` frames.
373+
These methods now appear as if it is in the Ruby source file,
374+
consistent with other C-implemented methods. [[Bug #20968]]
375+
376+
Before:
377+
```
378+
ruby -e '[1].fetch_values(42)'
379+
<internal:array>:211:in 'Array#fetch': index 42 outside of array bounds: -1...1 (IndexError)
380+
from <internal:array>:211:in 'block in Array#fetch_values'
381+
from <internal:array>:211:in 'Array#map!'
382+
from <internal:array>:211:in 'Array#fetch_values'
383+
from -e:1:in '<main>'
384+
```
385+
386+
After:
387+
```
388+
$ ruby -e '[1].fetch_values(42)'
389+
-e:1:in 'Array#fetch_values': index 42 outside of array bounds: -1...1 (IndexError)
390+
from -e:1:in '<main>'
391+
```
392+
350393
## Stdlib compatibility issues
351394

352395
* CGI library is removed from the default gems. Now we only provide `cgi/escape` for
@@ -446,6 +489,7 @@ A lot of work has gone into making Ractors more stable, performant, and usable.
446489
[Feature #20750]: https://bugs.ruby-lang.org/issues/20750
447490
[Feature #20884]: https://bugs.ruby-lang.org/issues/20884
448491
[Feature #20925]: https://bugs.ruby-lang.org/issues/20925
492+
[Bug #20968]: https://bugs.ruby-lang.org/issues/20968
449493
[Feature #20971]: https://bugs.ruby-lang.org/issues/20971
450494
[Bug #20974]: https://bugs.ruby-lang.org/issues/20974
451495
[Feature #21047]: https://bugs.ruby-lang.org/issues/21047
@@ -470,8 +514,10 @@ A lot of work has gone into making Ractors more stable, performant, and usable.
470514
[Feature #21390]: https://bugs.ruby-lang.org/issues/21390
471515
[Feature #21459]: https://bugs.ruby-lang.org/issues/21459
472516
[Feature #21527]: https://bugs.ruby-lang.org/issues/21527
517+
[Feature #21543]: https://bugs.ruby-lang.org/issues/21543
473518
[Feature #21550]: https://bugs.ruby-lang.org/issues/21550
474519
[Feature #21557]: https://bugs.ruby-lang.org/issues/21557
475520
[Bug #21654]: https://bugs.ruby-lang.org/issues/21654
476521
[Feature #21678]: https://bugs.ruby-lang.org/issues/21678
522+
[Bug #21698]: https://bugs.ruby-lang.org/issues/21698
477523
[Feature #21701]: https://bugs.ruby-lang.org/issues/21701

0 commit comments

Comments
 (0)