From e80ef37d04aa8872ec94644535f982893968ff5e Mon Sep 17 00:00:00 2001 From: Daniel Griesser Date: Thu, 9 May 2024 07:47:50 +0200 Subject: [PATCH 1/2] feat: Add bun global error handlers --- packages/bun/src/sdk.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/bun/src/sdk.ts b/packages/bun/src/sdk.ts index e9aabf5dae79..3f696e9d5122 100644 --- a/packages/bun/src/sdk.ts +++ b/packages/bun/src/sdk.ts @@ -12,6 +12,8 @@ import { modulesIntegration, nativeNodeFetchIntegration, nodeContextIntegration, + onUncaughtExceptionIntegration, + onUnhandledRejectionIntegration } from '@sentry/node'; import type { Integration, Options } from '@sentry/types'; @@ -33,9 +35,9 @@ export function getDefaultIntegrations(_options: Options): Integration[] { consoleIntegration(), httpIntegration(), nativeNodeFetchIntegration(), - // Global Handlers # TODO (waiting for https://github.com/oven-sh/bun/issues/5091) - // new NodeIntegrations.OnUncaughtException(), - // new NodeIntegrations.OnUnhandledRejection(), + // Global Handlers + onUncaughtExceptionIntegration(), + onUnhandledRejectionIntegration(), // Event Info contextLinesIntegration(), nodeContextIntegration(), From fe960c054a415e6f2762fb2b27e49f3f96dd4f94 Mon Sep 17 00:00:00 2001 From: Daniel Griesser Date: Fri, 10 May 2024 08:48:38 +0200 Subject: [PATCH 2/2] fix: Formatting --- packages/bun/src/sdk.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/bun/src/sdk.ts b/packages/bun/src/sdk.ts index 3f696e9d5122..f299c8119985 100644 --- a/packages/bun/src/sdk.ts +++ b/packages/bun/src/sdk.ts @@ -13,7 +13,7 @@ import { nativeNodeFetchIntegration, nodeContextIntegration, onUncaughtExceptionIntegration, - onUnhandledRejectionIntegration + onUnhandledRejectionIntegration, } from '@sentry/node'; import type { Integration, Options } from '@sentry/types';