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

Cannot configure the capture group for line matches #41

Open
lguychard opened this issue May 22, 2019 · 0 comments
Open

Cannot configure the capture group for line matches #41

lguychard opened this issue May 22, 2019 · 0 comments
Assignees

Comments

@lguychard
Copy link

The example configuration says for lineMatches:

Make sure to capture the error message in a RegExp group

Problem: a RegExp can specify several capture groups, for instance:

/throw new ([A-Z][a-z]+)+(['"]([\w\s]+)['"])/

In this case, I don't know which capture group the Sentry extension will use. Possible solutions:

  • Document the capture group used by the Sentry exception; users must write RegExps where that capture group always contains the error message to be used in the query string.
  • Allow to specify through configuration the capture group that should be used through the query string, eg. "lineMatches": [{ "pattern": "throw new ([A-Z][a-z]+)+(['\"]([\w\s]+)['\"])", "captureGroup": "2"}]
  • Allow to specify through configuration a template where one or more capture groups could be interpolated, eg.: "lineMatches": [{ "pattern": "throw new ([A-Z][a-z]+)+(['\"]([\w\s]+)['\"])", "searchQuery": "$1: $2"}], which would allow, given throw new CustomError("derp") to search for "CustomError: derp" on Sentry.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants