Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

child_process, process: possibly confusing error message #20314

Closed
vsemozhetbyt opened this issue Apr 26, 2018 · 2 comments
Closed

child_process, process: possibly confusing error message #20314

vsemozhetbyt opened this issue Apr 26, 2018 · 2 comments
Labels
child_process Issues and PRs related to the child_process subsystem. errors Issues and PRs related to JavaScript errors originated in Node.js core. process Issues and PRs related to the process subsystem.

Comments

@vsemozhetbyt
Copy link
Contributor

  • Version: all?
  • Platform: all?
  • Subsystem: child_process, process

parent.js:

'use strict';

const subprocess = require('child_process').fork('subprocess.js');

try {
  subprocess.send(Symbol());
} catch (err) {
  console.error('PARENT error:', err);
}

subprocess.js:

'use strict';

process.on('uncaughtException', (err) => {
  console.log('SUBPROCESS error:', err);
});

process.on('message', (msg) => {
  console.log('SUBPROCESS got message:', msg);
});

Output:

SUBPROCESS error: SyntaxError: Unexpected token u in JSON at position 0
    at JSON.parse (<anonymous>)
    at Pipe.channel.onread (internal/child_process.js:492:28)
  1. Should we intercept unserializable values at the sending side?
  2. If not, should we make the error message on receiving side more clear?
@vsemozhetbyt vsemozhetbyt added child_process Issues and PRs related to the child_process subsystem. process Issues and PRs related to the process subsystem. errors Issues and PRs related to JavaScript errors originated in Node.js core. labels Apr 26, 2018
@joyeecheung
Copy link
Member

Option 1 SGTM.

gireeshpunathil added a commit to gireeshpunathil/node that referenced this issue Mar 18, 2019
Error messages coming out of de-serialization at the send target
is not consumable. So detect the scenario and fix it at the send source

Ref: nodejs#20314

PR-URL: nodejs#24787
Reviewed-By: Luigi Pinca <[email protected]>
@vsemozhetbyt
Copy link
Contributor Author

This seems addressed in daa97df

targos pushed a commit to targos/node that referenced this issue Mar 27, 2019
Error messages coming out of de-serialization at the send target
is not consumable. So detect the scenario and fix it at the send source

Ref: nodejs#20314

PR-URL: nodejs#24787
Reviewed-By: Luigi Pinca <[email protected]>
targos pushed a commit that referenced this issue Mar 27, 2019
Error messages coming out of de-serialization at the send target
is not consumable. So detect the scenario and fix it at the send source

Ref: #20314

PR-URL: #24787
Reviewed-By: Luigi Pinca <[email protected]>
BethGriggs pushed a commit that referenced this issue Apr 17, 2019
Error messages coming out of de-serialization at the send target
is not consumable. So detect the scenario and fix it at the send source

Ref: #20314

PR-URL: #24787
Reviewed-By: Luigi Pinca <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
child_process Issues and PRs related to the child_process subsystem. errors Issues and PRs related to JavaScript errors originated in Node.js core. process Issues and PRs related to the process subsystem.
Projects
None yet
Development

No branches or pull requests

2 participants