Skip to content

Commit

Permalink
show: improve processed StackTrace check (JuliaLang#54381)
Browse files Browse the repository at this point in the history
This change is necessary for widely-typed vectors of stack traces to
work correctly:
```julia
Base.show_backtrace(stdout, convert(Vector{Any}, Base.stacktrace()))
```

which currently outputs a confusing error:
```julia
Stacktrace:
ERROR: MethodError: no method matching iterate(::Base.StackTraces.StackFrame)
...
```
  • Loading branch information
topolarity authored and lazarusA committed Jul 12, 2024
1 parent dd9f60b commit 095f864
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion base/errorshow.jl
Original file line number Diff line number Diff line change
Expand Up @@ -800,7 +800,7 @@ function show_backtrace(io::IO, t::Vector)
end

# t is a pre-processed backtrace (ref #12856)
if t isa Vector{Any}
if t isa Vector{Any} && (length(t) == 0 || t[1] isa Tuple{StackFrame,Int})
filtered = t
else
filtered = process_backtrace(t)
Expand Down

0 comments on commit 095f864

Please sign in to comment.