mirror of https://github.com/nodejs/node.git
child_process: emit 'channel closed' error instead of throwing
parent
89653cb32f
commit
ab32e9e043
|
@ -102,7 +102,10 @@ function setupChannel(target, channel) {
|
|||
throw new TypeError('message cannot be undefined');
|
||||
}
|
||||
|
||||
if (!this.connected) throw new Error('channel closed');
|
||||
if (!this.connected) {
|
||||
this.emit('error', new Error('channel closed'));
|
||||
return;
|
||||
}
|
||||
|
||||
// For overflow protection don't write if channel queue is too deep.
|
||||
if (channel.writeQueueSize > 1024 * 1024) {
|
||||
|
|
Loading…
Reference in New Issue