-
Notifications
You must be signed in to change notification settings - Fork 1.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
Error handling for VS Code #6146
Comments
EDIT |
This comment is related (please hit me up for more context if needed). |
I think any API-via-CLI we add to DVC should be in a format that's usable by as many applications as possible, even if VS Code is going to be the only one using it for a while. Formatting ErrorsI think a simple, flexible way to convey errors in JSON is a consistent minimal error interface like I can't see any alternatives that provide the same functionality, so for the most part I'm assuming that solutions will output errors in this format: Formatting
|
Great points!
Won't this same concern will apply for
Is the main difference from current behavior that errors are formatted as one line per error? |
While a bit outside of this error-focused ticket, I agree. Even machine-readable output can benefit from continuous updates.
Current DVC, if it errors, errors normally with non-json output so the new behavior would basically change everything. I haven't actually run #5984, so I can't yet comment on the difference between its implementation and what I'm thinking. I would imagine my envisioned behavior is very similar to standard output printing, but all the human-readable messages are machine-readable JSON instead. |
Okay, I misunderstood. So you are suggesting that when an error occurs, information about the error is put into a standalone json object that is output to It looks like the approach in #5984 for |
That's a fine approach, but embedding the errors in output depends on the command being finished and outputting, which is what I was attempting to address specifically for long-running commands like
This is where the That all said, the VS Code extension can adapt to whatever data shape the DVC team decides on, we just need the data to be there and know how to get at it. |
It feels that for a command like |
@shcheklein Good point, and I'd also like to bring up the fact that it seems In this case, the VSCode extension can adapt to whatever solution works for displaying these errors in If we do decide to display errors differently between commands (which certainly has its merits), we should make sure to document that this is the case on each command that does so, not just for VS Code but for all integrations, especially ones that don't original internally. |
To clarify here a bit. By |
Related #6042 |
@rogermparent #5984 has been merged, it introduces "error" key in original json for |
@mattseddon discovered this and took it on yesterday with iterative/vscode-dvc#660, |
@pared I've raised iterative/vscode-dvc#662 to deal with the new data and how we are going to display it. I'll be back in touch as soon as I have more information 👍🏻 . |
I would say there should be some callback one may setup to get errors. So that API users might see those too. |
@Suor |
@mattseddon Can we close this issue and continue discussion in iterative/vscode-dvc#662? |
Extracted from #5984 (comment).
How can the granular error info from that PR be consumed by VS Code (and possibly other apps)? Need a way to pass that info in a machine-readable format. Also need to consider whether this is generally useful information for all users who want machine-readable output, or is this a special format for VS Code and maybe other internal applications?
cc @shcheklein @rogermparent @mattseddon
The text was updated successfully, but these errors were encountered: