Skip to content

feat(browser): error filters and linked error causes - #1146

Merged
Makisuo merged 4 commits into
feat/browser-sdk-logs-samplingfrom
feat/browser-sdk-error-filters
Sep 29, 2026
Merged

Makisuo merged 4 commits into
feat/browser-sdk-logs-samplingfrom
feat/browser-sdk-error-filters

fix(browser): global regexes in error filters match every error

c095d88
Select commit
Loading
Failed to load commit list.
Maple Review Bot / Maple / review succeeded Sep 29, 2026 in 7m 49s

Confidence 4/5 · No issues found

Confidence 4/5 · likely safe to merge
F2's fix is real and the new filter path is unit- and browser-tested; only the frame-URL regex's less common formats are untested.
quality 100/100 · no findings · tests covered · risk medium

Adds errors capture filters (ignore/denyUrls/allowUrls/beforeCapture plus default extension and ResizeObserver drops) evaluated before the exception span is created, and appends cause/AggregateError chains to exception.stacktrace. The global-regex fix at this head is correct; safe to merge.

  • shouldCapture drops ignored, extension and ResizeObserver errors before recordException starts a span
  • configureErrorFilters wires config.errors through init and the runtime shutdown
  • exceptionOf appends Caused by: blocks from cause and AggregateError chains to exception.stacktrace
  • window.onerror passes event.filename as the top frame when no Error was thrown

Fixed since the last review

  • F2 · A /g regex in ignore/denyUrls/allowUrls matches only every other error
What was checked
  • matches resets pattern.lastIndex before test (error-filters.ts:50), so /g ignore lists drop every match — F2's defect is gone
  • FRAME_URL reads V8 and SpiderMonkey frames and not a URL in the message line (error-filters.test.ts:23, :34)
  • frameUrl from window.onerror takes precedence over a wrapped Error's SDK stack (error-filters.ts:68, errors.ts:150)

c095d88 · Updated on every push. Reply "won't fix" to dismiss a finding, or mention @maple to ask about one.