-
Notifications
You must be signed in to change notification settings - Fork 60
More elaborate error message for users on reanalyze json error #544
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
Conversation
…g an instruction on what to do with the error
let outputChannel = window.createOutputChannel( | ||
"ReScript Language Server", | ||
"rescript" | ||
); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Creating and passing around an explicit output channel lets us have a good place to log things to, that's also easy to reveal programatically.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great!
In addition, I was wondering whether we could issue a reproducible command. As that's required to produce the JSON in the first place.
That I guess would amount to pasting the command used to run the analysis.
Or even a few words on how to report an issue (which requires a repro project together wit the command).
This is great! |
Yup! |
The error itself when trying to parse the JSON is no longer logged, is that intentional? |
Yes, it's intentional. But it can be added again if it's considered helpful. I didn't think a random json error message would help anyone though as it's the accompanying json one is interested in to fix the issue, and the error itself can be reproduced by trying to parse the faulty json. |
How about an analogous one when there's an issue parsing the compiler log, as it's much more likely to happen and/or regress. |
@cristianoc yes, this is a good idea. I can do that once I'm out of the woods on the current things I'm working on. Adding a new ticket to make sure it isn't lost. |
Follow up for: #537
This logs a more elaborate error for the user, including instructions on how to report the error, when reanalyze json is invalid for some reason.