Classify report dialog errors (#11354)

This commit is contained in:
Samuel Newman
2026-08-03 18:00:25 +03:00
committed by GitHub
parent e99e04a458
commit 1cc942a869
6 changed files with 272 additions and 6 deletions
+14
View File
@@ -242,6 +242,20 @@ describe('general functionality', () => {
__context__: 'logger',
},
})
const fingerprint = ['{{ default }}', 'report-dialog:upstream-fetch']
sentryTransport(
LogLevel.Error,
Logger.Context.ReportDialog,
e,
{fingerprint},
timestamp,
)
expect(Sentry.captureException).toHaveBeenLastCalledWith(e, {
tags: {category: 'report-dialog'},
extra: {__context__: 'report-dialog'},
fingerprint,
})
})
test('sentryTransport serializes errors', () => {
+3 -1
View File
@@ -7,7 +7,7 @@ export const sentryTransport: Transport = (
level,
context,
message,
{type, tags, ...metadata},
{type, tags, fingerprint, ...metadata},
timestamp,
) => {
// Skip debug messages entirely for now - esb
@@ -70,6 +70,7 @@ export const sentryTransport: Transport = (
level: severity,
tags: _tags,
extra: meta,
...(fingerprint ? {fingerprint} : {}),
})
}
} else {
@@ -84,6 +85,7 @@ export const sentryTransport: Transport = (
Sentry.captureException(message, {
tags: _tags,
extra: meta,
...(fingerprint ? {fingerprint} : {}),
})
}
}
+6
View File
@@ -82,6 +82,12 @@ export type Metadata = {
[key: string]: number | string | boolean | null | undefined
}
/**
* Passed through to Sentry as a custom fingerprint. Include
* `{{ default }}` to preserve Sentry's default grouping and add dimensions.
*/
fingerprint?: string[]
/**
* Any additional data, passed through to Sentry as `extra` param on
* exceptions, or the `data` param on breadcrumbs.