-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Discussion about error reporting in the REPL, should it be customizable? #18068
Comments
Of the problems you list, the one I can unequivocally agree with is the difficulty of reading the types. But I don't have a great idea for how to print them without making the display longer in the vertical direction. About the only good idea I've had is that this would be solvable in an IDE where you can click-to-expand the type parameters. They start out compact ("folded") by default. |
👍 For me, only printing the actual error, the function names, and the line numbers in red would go a long way. Once I got the line-number it's easy to also see the file without it being printed in red, and it would also be easy to ignore the noise from the types. But keeping the types is probably good when further digging is necessary. I suspect adding more colors is not going to help much or any. |
What about writing the full error report into some error-log file and minimize the REPL output to just basic information (such as demonstrated in https://github.com/KristofferC/ErrorMessages.jl.)? So even if limited information is given on the REPL, one could still get the full info looking into the log file? |
Perhaps but it can be annoying to go look in a log file. I still feel like in order for everyone to be happy it needs to be customizable and that you can rethrow the last error with new verbosity settings in case you want to examine it more carefully. |
Yes, it should be combination of both. You customize the REPL for your needs to get acceptable noise level. But then you face a rare bug in a day running monte-carlo simulation on parallel nodes and before you get the change to re-throw the last error it is already gone and you have no way to investigate it. |
I think the ideal experience would be interactive: we show information about the line that we actually think has the problem; if you want more detail, you click on it to see more detail. This is presumably possible in an environment like Juno, maybe in Jupyter, but very hard in a terminal. So maybe the last error could be bound, by default to |
This is fixed now in my opinion. |
TLDR: Error messages in the REPL can get very long and have low signal to noise ratio. Maybe there should be an option to determine how they are printed?
I don't know if this could be considered a "julep" but I think it would be good to have a discussion about the error messages we print. There are two main reasons that I think causes large error messages in Julia:
The combination of the points above leads to backtraces that for me at least commonly look like this. While sometimes being good to have all the details i personally often get lost in this "Red Sea" looking for the line in my own code where the problem is.
I believe a one size fits all approach for printing errors is not going to work due to different demands in different situation so what is needed is to let the user have some control over the way the errors are printed. A few questions that naturally arises are:
showerror
functions and theshow
function for aStackFrame
? CouldIOContext
be used for that?Right now, I would say that the biggest source of noise are the types of the function arguments in the backtrace. I am almost never interested in them and if happen to be I could just go to the source location and look at them. Having an option to not print those would get a long way.
I have experimented a bit in a package that just rudely overwrites a few methods in Base so that you can set some options in https://github.com/KristofferC/ErrorMessages.jl.
Some other random suggestions / ideas:
Would be interesting to hear your ideas / comments. :)
cc @jakebolewski
The text was updated successfully, but these errors were encountered: