Custom `showerror` doesn't always trigger

question

#1

I’m having some trouble implementing a custom exception: the showerror only works in the REPL.

type Bad <: Exception
end

Base.showerror(io::IO, e::Bad) = print(io, "Good")

throw(Bad())

Doing this in the REPL calls into my showerror:

julia> throw(Bad())
ERROR: Good

But invoking as a script doesn’t:

$ julia /tmp/test.jl
ERROR: LoadError: Bad()

This definitely used to work in the past, and does work with exceptions part of the sysimg (eg. PkgError). Could this be a #265-fallout issue (possibly related to #19864), or am I missing something?


#2

Turned out to be world error, solved by https://github.com/JuliaLang/julia/pull/20497