More concise error message for schema validation errors#32
Merged
aeschli merged 1 commit intomicrosoft:masterfrom Oct 24, 2018
Merged
More concise error message for schema validation errors#32aeschli merged 1 commit intomicrosoft:masterfrom
aeschli merged 1 commit intomicrosoft:masterfrom
Conversation
Don't repeat the same cause 'Poblem loading schema from <url>' three times in a single error message. We now only show the actual network error, one description, and the URL.
Collaborator
|
Change makes sense. Thanks! |
Contributor
Author
|
Apparently, there was a test for the exact message, which fails now: https://travis-ci.org/Microsoft/vscode-json-languageservice/builds/445672376?utm_source=github_status&utm_medium=notification I didn't see that there were tests I needed to run, the correct build command (I used I'll create another one to fix that real quick. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ellipsis
The error message shown if a schema could not be retrieved is currently not very concise, it repeats the same sentence three times. This PR shortens it a little.
ref: microsoft/vscode#60219 (comment) by @aeschli
Old message:

New message:

How this works is that it strips everything before
Error:in the message returned by the backend, ifError:appears in the message. In the messages I observed, the removed part was something likeUnable to connect to <url>: Error:, which is redundant because it's prepended by the only caller anyways.I wasn't sure about the exact desired format of the error message, so if another format is better, I can change it. One issue with the current one is that it doesn't explicitly state that a schema is the problem. However I didn't want to change an already-translated message since translations would need to update.