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
error messages should provide more context (e.g., the function, file and line number) #2860
Comments
The |
No argument from me. But sometimes practicality trumps CS design principles. I'm willing to bet that the single most perplexing problem fish users experience is I'll admit I haven't actually thought much about how to actually implement this. My hope would be that the debug() function would be able to ascertain the context that produced the message and automatically include it in the output. That way, assuming the builtin test code uses P.S., This is probably a good time to repeat my observation in a different issue that how the debug() function is used is weird. I'd much rather see something akin to the Python logging subsystem where you pass a parameter that explicitly states whether its an error, warning, info, or debug level message. Alternatively, introduce |
It does, since 785945c.
|
Is it useful to have the backtrace show if we are interactive and input was stdin? The backtrace output is pretty jarring IMO. It just kind of appears out of nowhere: It does not look like the short and sweet output you expect from the
An improvement which would make it less confusing would be to display the error in the backtrace as part of the flow like we do in parse errors. It might look like:
Also, the carats always only point at the beginning of the current line, which is always a |
I've noticed that people are mystified by error messages like the following (from issue #2859):
I've seen such errors myself during the startup of a fish session and it was overly difficult to figure out what was wrong with my config.fish.
For error messages generated by fish, as opposed to external programs, it would be extremely helpful if they included some context. Such as the file and line number of the code being executed and/or the function being run at the time of the error.
The text was updated successfully, but these errors were encountered: