Skip to content

Commit

Permalink
Merge pull request #18726 from JuliaLang/kc/limited_error
Browse files Browse the repository at this point in the history
RFC: use limit true IOContext when showing errors in the REPL
  • Loading branch information
JeffBezanson authored Nov 2, 2016
2 parents b7f1aa7 + 180ec60 commit 10ffbae
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion base/REPL.jl
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ function display_error(io::IO, er, bt)
if eval_ind != 0
bt = bt[1:eval_ind-1]
end
Base.showerror(io, er, bt)
Base.showerror(IOContext(io, :limit => true), er, bt)
end
end

Expand Down
10 changes: 10 additions & 0 deletions test/repl.jl
Original file line number Diff line number Diff line change
Expand Up @@ -532,3 +532,13 @@ if !is_windows() || Sys.windows_version() >= Sys.WINDOWS_VISTA_VER
@test readstring(outs) == "1\n"
end
end # let exename

# Test containers in error messages are limited #18726
let io = IOBuffer()
REPL.display_error(io,
try [][trues(6000)]
catch e
e
end, [])
@test length(takebuf_string(io)) < 1500
end

0 comments on commit 10ffbae

Please sign in to comment.