diff --git a/dev-packages/e2e-tests/test-applications/solid-solidrouter/tests/errorboundary.test.ts b/dev-packages/e2e-tests/test-applications/solid-solidrouter/tests/errorboundary.test.ts index 287642424850..14396feb2334 100644 --- a/dev-packages/e2e-tests/test-applications/solid-solidrouter/tests/errorboundary.test.ts +++ b/dev-packages/e2e-tests/test-applications/solid-solidrouter/tests/errorboundary.test.ts @@ -15,7 +15,7 @@ test('captures an exception', async ({ page }) => { type: 'ReferenceError', value: 'NonExistentComponent is not defined', mechanism: { - type: 'generic', + type: 'auto.function.solid.error_boundary', handled: true, }, }, @@ -39,7 +39,7 @@ test('captures a second exception after resetting the boundary', async ({ page } type: 'ReferenceError', value: 'NonExistentComponent is not defined', mechanism: { - type: 'generic', + type: 'auto.function.solid.error_boundary', handled: true, }, }, @@ -64,7 +64,7 @@ test('captures a second exception after resetting the boundary', async ({ page } type: 'ReferenceError', value: 'NonExistentComponent is not defined', mechanism: { - type: 'generic', + type: 'auto.function.solid.error_boundary', handled: true, }, }, diff --git a/dev-packages/e2e-tests/test-applications/solid/tests/errorboundary.test.ts b/dev-packages/e2e-tests/test-applications/solid/tests/errorboundary.test.ts index d192ed9cfcfd..896426e1765c 100644 --- a/dev-packages/e2e-tests/test-applications/solid/tests/errorboundary.test.ts +++ b/dev-packages/e2e-tests/test-applications/solid/tests/errorboundary.test.ts @@ -22,7 +22,7 @@ test('captures an exception', async ({ page }) => { type: 'Error', value: 'Error 1 thrown from Sentry ErrorBoundary in Solid E2E test app', mechanism: { - type: 'generic', + type: 'auto.function.solid.error_boundary', handled: true, }, }, @@ -53,7 +53,7 @@ test('captures a second exception after resetting the boundary', async ({ page } type: 'Error', value: 'Error 1 thrown from Sentry ErrorBoundary in Solid E2E test app', mechanism: { - type: 'generic', + type: 'auto.function.solid.error_boundary', handled: true, }, }, @@ -82,7 +82,7 @@ test('captures a second exception after resetting the boundary', async ({ page } type: 'Error', value: 'Error 2 thrown from Sentry ErrorBoundary in Solid E2E test app', mechanism: { - type: 'generic', + type: 'auto.function.solid.error_boundary', handled: true, }, }, diff --git a/dev-packages/e2e-tests/test-applications/solidstart-dynamic-import/tests/errorboundary.test.ts b/dev-packages/e2e-tests/test-applications/solidstart-dynamic-import/tests/errorboundary.test.ts index 599b5c121455..63b46a5870ec 100644 --- a/dev-packages/e2e-tests/test-applications/solidstart-dynamic-import/tests/errorboundary.test.ts +++ b/dev-packages/e2e-tests/test-applications/solidstart-dynamic-import/tests/errorboundary.test.ts @@ -23,7 +23,7 @@ test('captures an exception', async ({ page }) => { type: 'Error', value: 'Error 1 thrown from Sentry ErrorBoundary in Solid Start E2E test app', mechanism: { - type: 'generic', + type: 'auto.function.solid.error_boundary', handled: true, }, }, @@ -53,7 +53,7 @@ test('captures a second exception after resetting the boundary', async ({ page } type: 'Error', value: 'Error 1 thrown from Sentry ErrorBoundary in Solid Start E2E test app', mechanism: { - type: 'generic', + type: 'auto.function.solid.error_boundary', handled: true, }, }, @@ -81,7 +81,7 @@ test('captures a second exception after resetting the boundary', async ({ page } type: 'Error', value: 'Error 2 thrown from Sentry ErrorBoundary in Solid Start E2E test app', mechanism: { - type: 'generic', + type: 'auto.function.solid.error_boundary', handled: true, }, }, diff --git a/dev-packages/e2e-tests/test-applications/solidstart-spa/tests/errorboundary.test.ts b/dev-packages/e2e-tests/test-applications/solidstart-spa/tests/errorboundary.test.ts index 692e19f54393..4cf6eccd4b71 100644 --- a/dev-packages/e2e-tests/test-applications/solidstart-spa/tests/errorboundary.test.ts +++ b/dev-packages/e2e-tests/test-applications/solidstart-spa/tests/errorboundary.test.ts @@ -21,7 +21,7 @@ test('captures an exception', async ({ page }) => { type: 'Error', value: 'Error 1 thrown from Sentry ErrorBoundary in Solid Start E2E test app', mechanism: { - type: 'generic', + type: 'auto.function.solid.error_boundary', handled: true, }, }, @@ -51,7 +51,7 @@ test('captures a second exception after resetting the boundary', async ({ page } type: 'Error', value: 'Error 1 thrown from Sentry ErrorBoundary in Solid Start E2E test app', mechanism: { - type: 'generic', + type: 'auto.function.solid.error_boundary', handled: true, }, }, @@ -79,7 +79,7 @@ test('captures a second exception after resetting the boundary', async ({ page } type: 'Error', value: 'Error 2 thrown from Sentry ErrorBoundary in Solid Start E2E test app', mechanism: { - type: 'generic', + type: 'auto.function.solid.error_boundary', handled: true, }, }, diff --git a/dev-packages/e2e-tests/test-applications/solidstart-top-level-import/tests/errorboundary.test.ts b/dev-packages/e2e-tests/test-applications/solidstart-top-level-import/tests/errorboundary.test.ts index 49f50f882b50..a362fc76de84 100644 --- a/dev-packages/e2e-tests/test-applications/solidstart-top-level-import/tests/errorboundary.test.ts +++ b/dev-packages/e2e-tests/test-applications/solidstart-top-level-import/tests/errorboundary.test.ts @@ -21,7 +21,7 @@ test('captures an exception', async ({ page }) => { type: 'Error', value: 'Error 1 thrown from Sentry ErrorBoundary in Solid Start E2E test app', mechanism: { - type: 'generic', + type: 'auto.function.solid.error_boundary', handled: true, }, }, @@ -51,7 +51,7 @@ test('captures a second exception after resetting the boundary', async ({ page } type: 'Error', value: 'Error 1 thrown from Sentry ErrorBoundary in Solid Start E2E test app', mechanism: { - type: 'generic', + type: 'auto.function.solid.error_boundary', handled: true, }, }, @@ -79,7 +79,7 @@ test('captures a second exception after resetting the boundary', async ({ page } type: 'Error', value: 'Error 2 thrown from Sentry ErrorBoundary in Solid Start E2E test app', mechanism: { - type: 'generic', + type: 'auto.function.solid.error_boundary', handled: true, }, }, diff --git a/dev-packages/e2e-tests/test-applications/solidstart/tests/errorboundary.test.ts b/dev-packages/e2e-tests/test-applications/solidstart/tests/errorboundary.test.ts index b709760aab94..9b169d6abda4 100644 --- a/dev-packages/e2e-tests/test-applications/solidstart/tests/errorboundary.test.ts +++ b/dev-packages/e2e-tests/test-applications/solidstart/tests/errorboundary.test.ts @@ -21,7 +21,7 @@ test('captures an exception', async ({ page }) => { type: 'Error', value: 'Error 1 thrown from Sentry ErrorBoundary in Solid Start E2E test app', mechanism: { - type: 'generic', + type: 'auto.function.solid.error_boundary', handled: true, }, }, @@ -51,7 +51,7 @@ test('captures a second exception after resetting the boundary', async ({ page } type: 'Error', value: 'Error 1 thrown from Sentry ErrorBoundary in Solid Start E2E test app', mechanism: { - type: 'generic', + type: 'auto.function.solid.error_boundary', handled: true, }, }, @@ -79,7 +79,7 @@ test('captures a second exception after resetting the boundary', async ({ page } type: 'Error', value: 'Error 2 thrown from Sentry ErrorBoundary in Solid Start E2E test app', mechanism: { - type: 'generic', + type: 'auto.function.solid.error_boundary', handled: true, }, }, diff --git a/packages/solid/src/errorboundary.ts b/packages/solid/src/errorboundary.ts index df75f9da80f9..aaf99c3f23b2 100644 --- a/packages/solid/src/errorboundary.ts +++ b/packages/solid/src/errorboundary.ts @@ -17,7 +17,12 @@ export function withSentryErrorBoundary(ErrorBoundary: Component void): JSX.Element => { - captureException(error); + captureException(error, { + mechanism: { + handled: true, // handled because user has to provide a fallback + type: 'auto.function.solid.error_boundary', + }, + }); const f = local.fallback; return typeof f === 'function' ? f(error, reset) : f; diff --git a/packages/solid/test/errorboundary.test.tsx b/packages/solid/test/errorboundary.test.tsx index 0ba1a2602bfe..53539e9b0d8e 100644 --- a/packages/solid/test/errorboundary.test.tsx +++ b/packages/solid/test/errorboundary.test.tsx @@ -49,7 +49,12 @@ describe('withSentryErrorBoundary', () => { )); expect(mockCaptureException).toHaveBeenCalledTimes(1); - expect(mockCaptureException).toHaveBeenLastCalledWith(new ReferenceError('NonExistentComponent is not defined')); + expect(mockCaptureException).toHaveBeenLastCalledWith(new ReferenceError('NonExistentComponent is not defined'), { + mechanism: { + handled: true, + type: 'auto.function.solid.error_boundary', + }, + }); }); it('renders the fallback component', async () => { @@ -89,13 +94,23 @@ describe('withSentryErrorBoundary', () => { )); expect(mockCaptureException).toHaveBeenCalledTimes(1); - expect(mockCaptureException).toHaveBeenNthCalledWith(1, new ReferenceError('NonExistentComponent is not defined')); + expect(mockCaptureException).toHaveBeenNthCalledWith(1, new ReferenceError('NonExistentComponent is not defined'), { + mechanism: { + handled: true, + type: 'auto.function.solid.error_boundary', + }, + }); const button = await findByRole('button'); await user.click(button); expect(mockCaptureException).toHaveBeenCalledTimes(2); - expect(mockCaptureException).toHaveBeenNthCalledWith(2, new ReferenceError('NonExistentComponent is not defined')); + expect(mockCaptureException).toHaveBeenNthCalledWith(2, new ReferenceError('NonExistentComponent is not defined'), { + mechanism: { + handled: true, + type: 'auto.function.solid.error_boundary', + }, + }); }); it('renders children when there is no error', async () => { diff --git a/packages/solidstart/test/client/errorboundary.test.tsx b/packages/solidstart/test/client/errorboundary.test.tsx index f1fc2c943ac1..099ab1f4bf2a 100644 --- a/packages/solidstart/test/client/errorboundary.test.tsx +++ b/packages/solidstart/test/client/errorboundary.test.tsx @@ -49,7 +49,12 @@ describe('withSentryErrorBoundary', () => { )); expect(mockCaptureException).toHaveBeenCalledTimes(1); - expect(mockCaptureException).toHaveBeenLastCalledWith(new ReferenceError('NonExistentComponent is not defined')); + expect(mockCaptureException).toHaveBeenLastCalledWith(new ReferenceError('NonExistentComponent is not defined'), { + mechanism: { + handled: true, + type: 'auto.function.solid.error_boundary', + }, + }); }); it('renders the fallback component', async () => { @@ -89,13 +94,23 @@ describe('withSentryErrorBoundary', () => { )); expect(mockCaptureException).toHaveBeenCalledTimes(1); - expect(mockCaptureException).toHaveBeenNthCalledWith(1, new ReferenceError('NonExistentComponent is not defined')); + expect(mockCaptureException).toHaveBeenNthCalledWith(1, new ReferenceError('NonExistentComponent is not defined'), { + mechanism: { + handled: true, + type: 'auto.function.solid.error_boundary', + }, + }); const button = await findByRole('button'); await user.click(button); expect(mockCaptureException).toHaveBeenCalledTimes(2); - expect(mockCaptureException).toHaveBeenNthCalledWith(2, new ReferenceError('NonExistentComponent is not defined')); + expect(mockCaptureException).toHaveBeenNthCalledWith(2, new ReferenceError('NonExistentComponent is not defined'), { + mechanism: { + handled: true, + type: 'auto.function.solid.error_boundary', + }, + }); }); it('renders children when there is no error', async () => { diff --git a/packages/solidstart/test/server/errorboundary.test.tsx b/packages/solidstart/test/server/errorboundary.test.tsx index afa2d44e98d7..3ed39bbfea13 100644 --- a/packages/solidstart/test/server/errorboundary.test.tsx +++ b/packages/solidstart/test/server/errorboundary.test.tsx @@ -49,7 +49,12 @@ describe('withSentryErrorBoundary', () => { )); expect(mockCaptureException).toHaveBeenCalledTimes(1); - expect(mockCaptureException).toHaveBeenLastCalledWith(new ReferenceError('NonExistentComponent is not defined')); + expect(mockCaptureException).toHaveBeenLastCalledWith(new ReferenceError('NonExistentComponent is not defined'), { + mechanism: { + handled: true, + type: 'auto.function.solid.error_boundary', + }, + }); }); it('renders the fallback component', async () => { @@ -89,13 +94,23 @@ describe('withSentryErrorBoundary', () => { )); expect(mockCaptureException).toHaveBeenCalledTimes(1); - expect(mockCaptureException).toHaveBeenNthCalledWith(1, new ReferenceError('NonExistentComponent is not defined')); + expect(mockCaptureException).toHaveBeenNthCalledWith(1, new ReferenceError('NonExistentComponent is not defined'), { + mechanism: { + handled: true, + type: 'auto.function.solid.error_boundary', + }, + }); const button = await findByRole('button'); await user.click(button); expect(mockCaptureException).toHaveBeenCalledTimes(2); - expect(mockCaptureException).toHaveBeenNthCalledWith(2, new ReferenceError('NonExistentComponent is not defined')); + expect(mockCaptureException).toHaveBeenNthCalledWith(2, new ReferenceError('NonExistentComponent is not defined'), { + mechanism: { + handled: true, + type: 'auto.function.solid.error_boundary', + }, + }); }); it('renders children when there is no error', async () => {