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

Fix-80080 Show more detailed error message for "Regex parse error" in search #80495

Merged
merged 6 commits into from Sep 16, 2019

Conversation

@skprabhanjan
Copy link
Contributor

commented Sep 6, 2019

@roblourens , Here is the PR to close #80080.
I thought the below format would be good.

"Regex Parse Error"
"regex could not be compiled with either the default regex engine or with PCRE2."
"error: " related to default regex
"PCRE2: " related to PCRE2 .

I need help on one more thing which I am not able to figure out.
By adding "\n" , the contents are not coming up in new line !

@skprabhanjan

This comment has been minimized.

Copy link
Contributor Author

commented Sep 6, 2019

Screen Shot 2019-09-06 at 9 45 43 PM

Copy link
Member

left a comment

Thanks for the PR, this is a good start. What I would like to see:

  • Only show the PCRE2 error message, without any "PCRE2" label
  • No newlines
  • Test cases
@skprabhanjan

This comment has been minimized.

Copy link
Contributor Author

commented Sep 7, 2019

@roblourens , All changes done according to the review :)
PS : I have added ( ; ) as the separator for the strings ( Looked good and more clean )
I can change it something else if you suggest :)

Copy link
Member

left a comment

Thanks, but I don't want to see the error message from the non-PCRE2 engine at all. These are just confusing implementation details that the user doesn't care about. It shouldn't show anything about "engines" or "compiling" or anything else besides the error that the PCRE2 engine gave. To me, this is the "real" error message.

@skprabhanjan

This comment has been minimized.

Copy link
Contributor Author

commented Sep 11, 2019

@roblourens , The changes are done .
Please let me know if there are any concerns :)

@skprabhanjan

This comment has been minimized.

Copy link
Contributor Author

commented Sep 16, 2019

@roblourens , Sorry for these little misses.
Its all done hopefully now :)
Please review this :)

}
});
return errorMessage.join(' : ');
let pcre2ErrorLine = lines.filter(l => (startsWith(l, 'PCRE2:')))[0];

This comment has been minimized.

Copy link
@roblourens

roblourens Sep 16, 2019

Member

This is better but pcre2ErrorLine will be undefined if there is no matching line. It shouldn't fail if the string is in an unexpected format.

@skprabhanjan

This comment has been minimized.

Copy link
Contributor Author

commented Sep 16, 2019

@roblourens , I wanted to do that check but was not sure as I assumed the error will be in that format always but It is fixed now.

Copy link
Member

left a comment

Thanks!

@roblourens roblourens merged commit 2d6ab9c into microsoft:master Sep 16, 2019
2 checks passed
2 checks passed
VS Code #20190916.42 succeeded
Details
license/cla All CLA requirements met.
Details
@roblourens roblourens added this to the September 2019 milestone Sep 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.