Skip to content

ref(browser): Adjust mechanism.type in globalHandlersIntegration #17299

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ sentryTest('handles fetch network errors @firefox', async ({ getLocalTestUrl, pa
value: error,
mechanism: {
handled: false,
type: 'onunhandledrejection',
type: 'auto.browser.global_handlers.onunhandledrejection',
},
});
});
Expand All @@ -51,7 +51,7 @@ sentryTest('handles fetch network errors on subdomains @firefox', async ({ getLo
value: error,
mechanism: {
handled: false,
type: 'onunhandledrejection',
type: 'auto.browser.global_handlers.onunhandledrejection',
},
});
});
Expand All @@ -78,7 +78,7 @@ sentryTest('handles fetch invalid header name errors @firefox', async ({ getLoca
value: error,
mechanism: {
handled: false,
type: 'onunhandledrejection',
type: 'auto.browser.global_handlers.onunhandledrejection',
},
stacktrace: {
frames: expect.any(Array),
Expand Down Expand Up @@ -110,7 +110,7 @@ sentryTest('handles fetch invalid header value errors @firefox', async ({ getLoc
value: error,
mechanism: {
handled: false,
type: 'onunhandledrejection',
type: 'auto.browser.global_handlers.onunhandledrejection',
},
stacktrace: {
frames: expect.any(Array),
Expand Down Expand Up @@ -152,7 +152,7 @@ sentryTest('handles fetch invalid URL scheme errors @firefox', async ({ getLocal
value: error,
mechanism: {
handled: false,
type: 'onunhandledrejection',
type: 'auto.browser.global_handlers.onunhandledrejection',
},
stacktrace: {
frames: expect.any(Array),
Expand Down Expand Up @@ -184,7 +184,7 @@ sentryTest('handles fetch credentials in url errors @firefox', async ({ getLocal
value: error,
mechanism: {
handled: false,
type: 'onunhandledrejection',
type: 'auto.browser.global_handlers.onunhandledrejection',
},
stacktrace: {
frames: expect.any(Array),
Expand Down Expand Up @@ -215,7 +215,7 @@ sentryTest('handles fetch invalid mode errors @firefox', async ({ getLocalTestUr
value: error,
mechanism: {
handled: false,
type: 'onunhandledrejection',
type: 'auto.browser.global_handlers.onunhandledrejection',
},
stacktrace: {
frames: expect.any(Array),
Expand Down Expand Up @@ -245,7 +245,7 @@ sentryTest('handles fetch invalid request method errors @firefox', async ({ getL
value: error,
mechanism: {
handled: false,
type: 'onunhandledrejection',
type: 'auto.browser.global_handlers.onunhandledrejection',
},
stacktrace: {
frames: expect.any(Array),
Expand Down Expand Up @@ -277,7 +277,7 @@ sentryTest(
value: error,
mechanism: {
handled: false,
type: 'onunhandledrejection',
type: 'auto.browser.global_handlers.onunhandledrejection',
},
stacktrace: {
frames: expect.any(Array),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ sentryTest(
type: 'Error',
value: 'Object captured as exception with keys: otherKey, type',
mechanism: {
type: 'onerror',
type: 'auto.browser.global_handlers.onerror',
handled: false,
},
stacktrace: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ sentryTest('should catch syntax errors', async ({ getLocalTestUrl, page, browser
type: 'SyntaxError',
value: "Failed to execute 'appendChild' on 'Node': Unexpected token '{'",
mechanism: {
type: 'onerror',
type: 'auto.browser.global_handlers.onerror',
handled: false,
},
stacktrace: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ sentryTest('should catch thrown errors', async ({ getLocalTestUrl, page, browser
type: 'Error',
value: 'realError',
mechanism: {
type: 'onerror',
type: 'auto.browser.global_handlers.onerror',
handled: false,
},
stacktrace: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ sentryTest('should catch thrown objects', async ({ getLocalTestUrl, page, browse
type: 'Error',
value: 'Object captured as exception with keys: error, somekey',
mechanism: {
type: 'onerror',
type: 'auto.browser.global_handlers.onerror',
handled: false,
},
stacktrace: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ sentryTest('should catch thrown strings', async ({ getLocalTestUrl, page, browse
type: 'Error',
value: 'stringError',
mechanism: {
type: 'onerror',
type: 'auto.browser.global_handlers.onerror',
handled: false,
},
stacktrace: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ sentryTest(
type: 'Error',
value: 'promiseError',
mechanism: {
type: 'onunhandledrejection',
type: 'auto.browser.global_handlers.onunhandledrejection',
handled: false,
},
stacktrace: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ sentryTest('should capture a random Event with type unhandledrejection', async (
type: 'Event',
value: 'Event `Event` (type=unhandledrejection) captured as promise rejection',
mechanism: {
type: 'onunhandledrejection',
type: 'auto.browser.global_handlers.onunhandledrejection',
handled: false,
},
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ sentryTest('should catch thrown errors', async ({ getLocalTestUrl, page }) => {
type: 'Error',
value: 'promiseError',
mechanism: {
type: 'onunhandledrejection',
type: 'auto.browser.global_handlers.onunhandledrejection',
handled: false,
},
stacktrace: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ sentryTest('should catch thrown strings', async ({ getLocalTestUrl, page }) => {
type: 'UnhandledRejection',
value: 'Non-Error promise rejection captured with value: null',
mechanism: {
type: 'onunhandledrejection',
type: 'auto.browser.global_handlers.onunhandledrejection',
handled: false,
},
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ sentryTest('should catch thrown strings', async ({ getLocalTestUrl, page }) => {
type: 'UnhandledRejection',
value: 'Non-Error promise rejection captured with value: 123',
mechanism: {
type: 'onunhandledrejection',
type: 'auto.browser.global_handlers.onunhandledrejection',
handled: false,
},
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ sentryTest('should capture unhandledrejection with a complex object', async ({ g
type: 'UnhandledRejection',
value: 'Object captured as promise rejection with keys: a, b, c, d, e',
mechanism: {
type: 'onunhandledrejection',
type: 'auto.browser.global_handlers.onunhandledrejection',
handled: false,
},
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ sentryTest('should capture unhandledrejection with an object', async ({ getLocal
type: 'UnhandledRejection',
value: 'Object captured as promise rejection with keys: a, b, c',
mechanism: {
type: 'onunhandledrejection',
type: 'auto.browser.global_handlers.onunhandledrejection',
handled: false,
},
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ sentryTest('should catch thrown strings', async ({ getLocalTestUrl, page }) => {
type: 'UnhandledRejection',
value: 'Non-Error promise rejection captured with value: stringError',
mechanism: {
type: 'onunhandledrejection',
type: 'auto.browser.global_handlers.onunhandledrejection',
handled: false,
},
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ sentryTest('should catch thrown strings', async ({ getLocalTestUrl, page }) => {
type: 'UnhandledRejection',
value: 'Non-Error promise rejection captured with value: undefined',
mechanism: {
type: 'onunhandledrejection',
type: 'auto.browser.global_handlers.onunhandledrejection',
handled: false,
},
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ test.describe('client-side errors', () => {
{
mechanism: {
handled: false,
type: 'onerror',
type: 'auto.browser.global_handlers.onerror',
},
type: 'Error',
value: 'client error',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ test.describe('client-side errors', () => {
{
mechanism: {
handled: false,
type: 'onerror',
type: 'auto.browser.global_handlers.onerror',
},
type: 'Error',
value: 'client error',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ test('sends an error', async ({ page }) => {
type: 'Error',
value: 'Error thrown from Solid E2E test app',
mechanism: {
type: 'onerror',
type: 'auto.browser.global_handlers.onerror',
handled: false,
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ test('sends an error', async ({ page }) => {
type: 'Error',
value: 'Error thrown from Solid E2E test app',
mechanism: {
type: 'onerror',
type: 'auto.browser.global_handlers.onerror',
handled: false,
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ test('errors on frontend and backend are connected by the same trace', async ({
{
mechanism: {
handled: false,
type: 'onunhandledrejection',
type: 'auto.browser.global_handlers.onunhandledrejection',
},
stacktrace: expect.any(Object),
type: 'Error',
Expand Down
4 changes: 2 additions & 2 deletions packages/browser/src/integrations/globalhandlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ function _installGlobalOnErrorHandler(client: Client): void {
originalException: error,
mechanism: {
handled: false,
type: 'onerror',
type: 'auto.browser.global_handlers.onerror',
},
});
});
Expand All @@ -98,7 +98,7 @@ function _installGlobalOnUnhandledRejectionHandler(client: Client): void {
originalException: error,
mechanism: {
handled: false,
type: 'onunhandledrejection',
type: 'auto.browser.global_handlers.onunhandledrejection',
},
});
});
Expand Down
Loading