diff --git a/base/client.jl b/base/client.jl index 67264f96fae0e..8a3df71dc0b4e 100644 --- a/base/client.jl +++ b/base/client.jl @@ -106,7 +106,7 @@ end display_error(stack::ExceptionStack) = display_error(stderr, stack) # these forms are depended on by packages outside Julia -function display_error(io::IO, exception, backtrace) +function display_error(io::IO, er, bt) printstyled(io, "ERROR: "; bold=true, color=Base.error_color()) showerror(IOContext(io, :limit => true), er, bt, backtrace = bt!==nothing) println(io) diff --git a/stdlib/REPL/test/repl.jl b/stdlib/REPL/test/repl.jl index e81b48f69f705..c2e1d45dd7af5 100644 --- a/stdlib/REPL/test/repl.jl +++ b/stdlib/REPL/test/repl.jl @@ -1402,4 +1402,6 @@ fake_repl() do stdin_write, stdout_read, repl @test readline(stdout_read) == "\e[0m1-element ExceptionStack:" @test readline(stdout_read) == "UndefVarError: foobar not defined" @test readline(stdout_read) == "Stacktrace:" + write(stdin_write, '\x04') + Base.wait(repltask) end diff --git a/test/client.jl b/test/client.jl index f917e45fb412d..195743b1d6208 100644 --- a/test/client.jl +++ b/test/client.jl @@ -43,3 +43,12 @@ end err_str = String(take!(errio)) @test occursin(nested_error_pattern, err_str) end + +@testset "display_error(io, er, bt) works" begin + errio = IOBuffer() + Base.display_error(errio, ErrorException, []) + err_str = String(take!(errio)) + @test occursin(r""" + ERROR: ErrorException + """s, err_str) +end