Может быть, не совсем то, что вы хотели, но это близко:
julia> # Sequence of dummy functions to generate long stack trace
f() = g()
g() = h()
h() = k()
k() = error("Hello world")
k (generic function with 2 methods)
julia> # Default: long stacktrace
f()
ERROR: Hello world
Stacktrace:
[1] error(::String) at ./error.jl:33
[2] k() at ./REPL[72]:5
[3] h() at ./REPL[72]:4
[4] g() at ./REPL[72]:3
[5] f() at ./REPL[72]:2
[6] top-level scope at REPL[73]:2
julia> # try/catch to eliminate stacktrace
try
f()
catch e
printstyled(stderr,"ERROR: ", bold=true, color=:red)
printstyled(stderr,sprint(showerror,e), color=:light_red)
println(stderr)
end
ERROR: Hello world