diff --git a/dev-packages/node-integration-tests/suites/public-api/onUnhandledRejectionIntegration/ignore-default.js b/dev-packages/node-integration-tests/suites/public-api/onUnhandledRejectionIntegration/ignore-default.js index 623aa8eaa8f7..f15c8b387036 100644 --- a/dev-packages/node-integration-tests/suites/public-api/onUnhandledRejectionIntegration/ignore-default.js +++ b/dev-packages/node-integration-tests/suites/public-api/onUnhandledRejectionIntegration/ignore-default.js @@ -13,10 +13,18 @@ class AI_NoOutputGeneratedError extends Error { } } +class AbortError extends Error { + constructor(message) { + super(message); + this.name = 'AbortError'; + } +} + setTimeout(() => { process.stdout.write("I'm alive!"); process.exit(0); }, 500); -// This should be ignored by default and not produce a warning +// These should be ignored by default and not produce a warning Promise.reject(new AI_NoOutputGeneratedError('Stream aborted')); +Promise.reject(new AbortError('Stream aborted')); diff --git a/dev-packages/node-integration-tests/suites/public-api/onUnhandledRejectionIntegration/test.ts b/dev-packages/node-integration-tests/suites/public-api/onUnhandledRejectionIntegration/test.ts index cd0627664ea3..c8570747cf8d 100644 --- a/dev-packages/node-integration-tests/suites/public-api/onUnhandledRejectionIntegration/test.ts +++ b/dev-packages/node-integration-tests/suites/public-api/onUnhandledRejectionIntegration/test.ts @@ -179,7 +179,7 @@ test rejection`); expect(transactionEvent!.contexts!.trace!.span_id).toBe(errorEvent!.contexts!.trace!.span_id); }); - test('should not warn when AI_NoOutputGeneratedError is rejected (default ignore)', () => + test('should not warn when AI_NoOutputGeneratedError or AbortError is rejected (default ignore)', () => new Promise(done => { expect.assertions(3); diff --git a/packages/node-core/src/integrations/onunhandledrejection.ts b/packages/node-core/src/integrations/onunhandledrejection.ts index 42a17e2e6c7e..af40bacfda57 100644 --- a/packages/node-core/src/integrations/onunhandledrejection.ts +++ b/packages/node-core/src/integrations/onunhandledrejection.ts @@ -27,7 +27,10 @@ const INTEGRATION_NAME = 'OnUnhandledRejection'; const DEFAULT_IGNORES: IgnoreMatcher[] = [ { - name: 'AI_NoOutputGeneratedError', // When stream aborts in Vercel AI SDK, Vercel flush() fails with an error + name: 'AI_NoOutputGeneratedError', // When stream aborts in Vercel AI SDK V5, Vercel flush() fails with an error + }, + { + name: 'AbortError', // When stream aborts in Vercel AI SDK V6 }, ];