Skip to content
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 @@ -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'));
Original file line number Diff line number Diff line change
Expand Up @@ -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<void>(done => {
expect.assertions(3);

Expand Down
5 changes: 4 additions & 1 deletion packages/node-core/src/integrations/onunhandledrejection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
},
];

Expand Down
Loading