Skip to content
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

more verbose, friendly error messages #36865

Closed
StefanKarpinski opened this issue Jul 31, 2020 · 4 comments
Closed

more verbose, friendly error messages #36865

StefanKarpinski opened this issue Jul 31, 2020 · 4 comments
Labels
domain:error handling Handling of exceptions by Julia or the user

Comments

@StefanKarpinski
Copy link
Sponsor Member

A lot of the error messages in Base are carefully worded to fit on a single line. This often comes at the cost of them being pretty inscrutable to new users. I'd like to propose a systematic effort to lengthen and clarify our error messages. There are many examples, but I was prompted to open this issue by this post on StackOverflow:

https://stackoverflow.com/questions/63188794/difference-between-fsstring-and-fstring

The question is not about inscrutable error messages, but the answer includes this error message:

ERROR: all-underscore identifier used as rvalue

I know what that means, but, man, that's not going to make sense to most people 😬. What's the best strategy for making all our error messages easier to understand for people who aren't deeply steeped in Julia development?

@StefanKarpinski StefanKarpinski added the domain:error handling Handling of exceptions by Julia or the user label Jul 31, 2020
@timholy
Copy link
Sponsor Member

timholy commented Aug 6, 2020

There are at least two things you can do in an error message: describe the problem and provide hints about how to fix it. The second is attractive but the first is much safer, and it's likely that only the first is always possible. So as a first pass I would focus on trying to come up with less jargon-heavy ways of saying the same thing.

I've long meant to do the same thing to the manual (which has some very newbie-friendly sections but some that are not), but that's a big task and it hasn't yet risen to the top for me.

@kimikage
Copy link
Contributor

kimikage commented Sep 5, 2020

For syntax errors, what about giving every error a unique type or a short unique string (e.g. "(all-underscore)") to its error message? I think the hints should be "rich" and the rich hints should only exist in the documentation.

I'm not happy with the hints of Rust's linter (clippy), but I think its ecosystem itself is great.
https://rust-lang.github.io/rust-clippy/master/index.html

@KristofferC
Copy link
Sponsor Member

Taking off the milestone.

@KristofferC KristofferC removed this from the 1.6 features milestone Oct 20, 2020
@vtjnash
Copy link
Sponsor Member

vtjnash commented Feb 1, 2024

Somewhat better now:

julia> __
ERROR: all-underscore identifiers are write-only and their values cannot be used in expressions

Still likely we should do a lot more to make our errors better, but this issue doesn't have an actionable list.

@vtjnash vtjnash closed this as completed Feb 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:error handling Handling of exceptions by Julia or the user
Projects
None yet
Development

No branches or pull requests

5 participants