It makes the stacktraces from the error handlers pretty much useless and hinders debugging. In particular, since exception is now just a string, the logging macros will elide most of the stacktrace. As an MWE:
julia> try
error("1234")
catch e
@error "Error handler" exception = sprint(Base.showerror, e, catch_backtrace())
end
┌ Error: Error handler
│ exception = "1234\nStacktrace:\n [1] error(s::String)\n @ Base ./error.jl:35\n [2] top-level scope\n @ REPL[9]:2\n [3] eval\n @ ./boot.jl:370 [inlined]\n [4] eval_user_input(ast::Any, backend::REPL.REPLBackend, mod::Module)\n @ REPL ~/.julia/juliaup/julia-1.9" ⋯ 974 bytes ⋯ "816 [inlined]\n [12] run_main_repl(interactive::Bool, quiet::Bool, banner::Bool, history_file::Bool, color_set::Bool)\n @ Base ./client.jl:405\n [13] exec_options(opts::Base.JLOptions)\n @ Base ./client.jl:322\n [14] _start()\n @ Base ./client.jl:522"
└ @ Main REPL[9]:4
Instead I suggest using the standard exception = (e, catch_backtrace()) pattern.
It makes the stacktraces from the error handlers pretty much useless and hinders debugging. In particular, since
exception
is now just a string, the logging macros will elide most of the stacktrace. As an MWE:Instead I suggest using the standard
exception = (e, catch_backtrace())
pattern.