-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Add codes and URLs to errors/warnings #474
Comments
You could consider using fransciscop/human-error to make errors more Elm-like. |
Oh cool, I wasn't aware of human-error. Looks great. I've been very inspired by Elm's approach to error message, hence this sort of thing: One of the great things about doing more of the work at compile time is you can really go to town on trying to figure out what the user meant by using string distance algorithms and AST traversal etc — stuff that would be considered extravagant at runtime even behind a I'd thought about having a troubleshooting page on the guide that error messages could link to (Rollup does this, errors and warnings will frequently point you towards sections on the wiki), but now that you point it out there's really no good reason not to put extensive documentation right there with the error message. Maybe a URL is still more appropriate for warnings, since they're not necessarily blockers and you might want to carry on working without your terminal being overtaken with documentation. |
Wonderfully done with the error messages — had yet to stumble upon them. :) And yes, URLs are indeed more appropriate for warnings. |
As a compiler I think providing error/warning messages in the outputted code for dev mode is the way to go. URLs require an internet connection and an extra step in figuring out what went wrong. Plus, if there's a warning there's also probably something to fix. |
Post-#473, it might be a nice idea to add codes and URLs to error and warnings objects generated during compilation. That way, custom handlers could easily filter out warnings, and we could print troubleshooting URLs for things that require more explanation than can fit in an error message.
The text was updated successfully, but these errors were encountered: