Skip to content

Commit

Permalink
REPL should call display_error in the latest world (fixes #19864)
Browse files Browse the repository at this point in the history
  • Loading branch information
stevengj committed Jan 7, 2017
1 parent 28a11ff commit 1b3d0b0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
3 changes: 2 additions & 1 deletion base/REPL.jl
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,8 @@ function print_response(errio::IO, val::ANY, bt, show_value::Bool, have_color::B
try
Base.sigatomic_end()
if bt !== nothing
Base.display_error(errio, val, bt)
eval(Main, Expr(:body, Expr(:return, Expr(:call, Base.display_error,
errio, QuoteNode(val), bt))))
iserr, lasterr = false, ()
else
if val !== nothing && show_value
Expand Down
10 changes: 10 additions & 0 deletions test/repl.jl
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,16 @@ if !is_windows() || Sys.windows_version() >= Sys.WINDOWS_VISTA_VER
end
end # let exename

# issue #19864:
type Error19864 <: Exception; end
function test19864()
eval(current_module(), :(Base.showerror(io::IO, e::Error19864) = print(io, "correct19864")))
buf = IOBuffer()
REPL.print_response(buf, Error19864(), [], false, false, nothing)
return String(take!(buf))
end
@test contains(test19864(), "correct19864")

# Test containers in error messages are limited #18726
let io = IOBuffer()
Base.display_error(io,
Expand Down

0 comments on commit 1b3d0b0

Please sign in to comment.