Skip to content

Cannot configure the capture group for line matches #41

@lguychard

Description

@lguychard

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions