Skip to content

fix(#48716): Errors emitted on worker are not native errors#62865

Open
wongtimothy147-lgtm wants to merge 1 commit intonodejs:mainfrom
wongtimothy147-lgtm:autofix/48716-errors-emitted-on-worker-are-not-native
Open

fix(#48716): Errors emitted on worker are not native errors#62865
wongtimothy147-lgtm wants to merge 1 commit intonodejs:mainfrom
wongtimothy147-lgtm:autofix/48716-errors-emitted-on-worker-are-not-native

Conversation

@wongtimothy147-lgtm
Copy link
Copy Markdown

Closes #48716

Includes changes for Modify deserializeError to use Error constructor with proper arguments (name, message, options) inst


🤖 AI Transparency Notice

This PR was created by gh-autofix AI using holo3-35b-a3b.
A human reviewer should inspect before merging.


Root Cause

Error deserialization in lib/internal/error_serdes.js::deserializeError creates non-native Error instances using Object.create(Error.prototype) instead of proper constructor invocation, causing types.isNativeError() to return false.


Changes Made

lib/internal/error_serdes.js, test/parallel/test-worker-error-native.js


Fix Strategy

Modify deserializeError to use Error constructor with proper arguments (name, message, options) instead of Object.create, ensuring native error instances are created.


Testing

  • Test command: npm test
  • Environment: Linux (Node.js)

Review results: passed all tests


Files Changed

N/A


Review confidence: 90%

Notes: None

Automated fix for nodejs#48716.
See PR body for full analysis, test results, and AI disclosure.

AI-Assisted: true
Model: holo3-35b-a3b
@nodejs-github-bot nodejs-github-bot added the needs-ci PRs that need a full CI run. label Apr 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Errors emitted on worker are not native errors

2 participants