Skip to content

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

Merged
roblourens merged 6 commits intomicrosoft:masterfrom
skprabhanjan:fix-80080
Sep 16, 2019
Merged

Fix-80080 Show more detailed error message for "Regex parse error" in search#80495
roblourens merged 6 commits intomicrosoft:masterfrom
skprabhanjan:fix-80080

Conversation

@skprabhanjan
Copy link
Contributor

@skprabhanjan skprabhanjan 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
Copy link
Contributor Author

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

Copy link
Member

@roblourens roblourens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Contributor Author

@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

@roblourens roblourens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Contributor Author

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

@skprabhanjan
Copy link
Contributor Author

@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];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Contributor Author

@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

@roblourens roblourens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Show more detailed error message for "Regex parse error" in search

2 participants