mirror of
https://github.com/nodejs/node.git
synced 2026-11-21 12:59:16 -05:00
child_process: ensure message sanity at source
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: https://github.com/nodejs/node/issues/20314 PR-URL: https://github.com/nodejs/node/pull/24787 Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
1 parent
993bdff9ff
commit
daa97df343
2 files changed
+18
No files matched your search
@@ -49,6 +49,12 @@ assert.throws(() => n.send(), {
|
||||
code: 'ERR_MISSING_ARGS'
|
||||
});
|
||||
|
||||
assert.throws(() => n.send(Symbol()), {
|
||||
name: 'TypeError [ERR_INVALID_ARG_TYPE]',
|
||||
message: 'The "message" argument must be one of type string,' +
|
||||
' object, number, or boolean. Received type symbol',
|
||||
code: 'ERR_INVALID_ARG_TYPE'
|
||||
});
|
||||
n.send({ hello: 'world' });
|
||||
|
||||
n.on('exit', common.mustCall((c) => {
|
||||
|
||||
Reference in new issue
Block a user