Skip to content
Open
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
4 changes: 4 additions & 0 deletions packages/node-core/src/integrations/systemError.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ function isSystemError(error: unknown): error is SystemError {

// Appears this is the recommended way to check for Node.js SystemError
// https://github.com/nodejs/node/issues/46869
if (typeof util.getSystemErrorMap !== 'function') {
return false;
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix PR missing regression test for the guard

Low Severity

This fix PR adds a typeof guard for util.getSystemErrorMap but does not include any unit, integration, or e2e test verifying that isSystemError returns false when util.getSystemErrorMap is undefined. A regression test mocking util.getSystemErrorMap as undefined would confirm the fix works and prevent future regressions.

Fix in Cursor Fix in Web

Triggered by project rule: PR Review Guidelines for Cursor Bot

Reviewed by Cursor Bugbot for commit d147bf4. Configure here.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding a small unit test would be great I think :) I just noticed there are none yet but it should go in packages/node-core/test/integrations/systemError.test.ts.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@claude can you add this test?


return util.getSystemErrorMap().has(error.errno);
}

Expand Down
Loading