I find run-time error messages that are displayed in the REPL hard to parse.
Perhaps this could be improved fairly easily. But first I wanted to check whether I am the only one who feels this way.
Here is a simple example with just a single error thrown by test
:
Model: Error During Test at /Users/lutz/Documents/julia/OptimizationLH/test/runtests.jl:4
Got exception outside of a @test
BoundsError: attempt to access 4×4 Array{Int64,2} at index [100, 200]
Stacktrace:
[1] setindex! at ./array.jl:768 [inlined]
[2] compute_stats(::Model, ::Array{Int64,2}, ::Array{Float64,2}) at /Users/lutz/Documents/julia/OptimizationLH/src/model.jl:98
[3] solve(::Model, ::OptimizationLH.ModelParams) at /Users/lutz/Documents/julia/OptimizationLH/src/model.jl:31
[4] top-level scope at /Users/lutz/Documents/julia/OptimizationLH/test/runtests.jl:22
[5] top-level scope at /Users/sabae/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.2/Test/src/Test.jl:1113
[6] top-level scope at /Users/lutz/Documents/julia/OptimizationLH/test/runtests.jl:5
[7] include at ./boot.jl:328 [inlined]
[8] include_relative(::Module, ::String) at ./loading.jl:1094
[9] include(::Module, ::String) at ./Base.jl:31
[10] include(::String) at ./client.jl:431
[11] top-level scope at none:5
[12] eval(::Module, ::Any) at ./boot.jl:330
[13] exec_options(::Base.JLOptions) at ./client.jl:271
[14] _start() at ./client.jl:464
All that I usually need to know at this point is:
- I have a bounds error
- it occurs in line 98 of
compute_stats
I come from Matlab where errors are far more compact.
I think it would generally be desirable to suppress references to built-in (as opposed to user written) code (especially lines 5 to 14.
A little bit of formatting would make this easier to read (note the long lines giving the entire method signature followed by “at line number in file”).
Ideally, I would like to see condensed information that can be expanded if the user needs it. Perhaps even opened in an editor instead of the REPL?
Or perhaps this is just me and I need to generate fewer errors…