Classify report dialog errors (#11354)
This commit is contained in:
@@ -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', () => {
|
||||
|
||||
@@ -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} : {}),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user