Open
Description
openedon Nov 2, 2022
Version info:
julia> versioninfo()
Julia Version 1.8.2
Commit 36034abf260 (2022-09-29 15:21 UTC)
Platform Info:
OS: macOS (x86_64-apple-darwin21.4.0)
CPU: 8 × Intel(R) Core(TM) i7-1068NG7 CPU @ 2.30GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-13.0.1 (ORCJIT, icelake-client)
Threads: 1 on 8 virtual cores
Installed Julia from https://julialang.org/downloads/, drag-n-drop to Applications folder.
MWE:
julia> f(x) = try throw("root cause"); catch e; throw("additional info $x"); end
f (generic function with 2 methods)
julia> f(1)
ERROR: "additional info 1"
Stacktrace:
[1] f(x::Int64)
@ Main ./REPL[19]:1
[2] top-level scope
@ REPL[20]:1
caused by: "root cause"
Stacktrace:
[1] f(x::Int64)
@ Main ./REPL[19]:1
[2] top-level scope
@ REPL[20]:1
julia> asyncmap(f, 1:3)
ERROR: "additional info 1"
Stacktrace:
[1] f(x::Int64)
@ Main ./REPL[19]:1
[2] (::Base.var"#929#934"{typeof(f)})(r::Base.RefValue{Any}, args::Tuple{Int64})
@ Base ./asyncmap.jl:100
[3] macro expansion
@ ./asyncmap.jl:234 [inlined]
[4] (::Base.var"#945#946"{Base.var"#929#934"{typeof(f)}, Channel{Any}, Nothing})()
@ Base ./task.jl:484
Stacktrace:
[1] (::Base.var"#939#941")(x::Task)
@ Base ./asyncmap.jl:177
[2] foreach(f::Base.var"#939#941", itr::Vector{Any})
@ Base ./abstractarray.jl:2774
[3] maptwice(wrapped_f::Function, chnl::Channel{Any}, worker_tasks::Vector{Any}, c::UnitRange{Int64})
@ Base ./asyncmap.jl:177
[4] wrap_n_exec_twice
@ ./asyncmap.jl:153 [inlined]
[5] #async_usemap#924
@ ./asyncmap.jl:103 [inlined]
[6] #asyncmap#923
@ ./asyncmap.jl:81 [inlined]
[7] asyncmap(f::Function, c::UnitRange{Int64})
@ Base ./asyncmap.jl:80
[8] top-level scope
@ REPL[21]:1
It seems asyncmap
doesn't print the caused by: "root cause"
that would otherwise be shown.
Related work:
- Throw
CapturedException
s from asyncmap to avoid dropping the stacktrace #42105: seems that before that MR not even the"additional info 1"
would be printed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment