Skip to content

Commit

Permalink
Merge pull request #19916 from stevengj/display_error
Browse files Browse the repository at this point in the history
display_error should call latest showerror
  • Loading branch information
JeffBezanson authored Jan 8, 2017
2 parents e693bb2 + 1b3d0b0 commit 23c5450
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 23c5450

Please sign in to comment.