Navigation Menu

Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
child_process: emit 'channel closed' error instead of throwing
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreasMadsen authored and isaacs committed Mar 19, 2012
1 parent 89653cb commit ab32e9e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/child_process.js
Expand Up @@ -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) {
Expand Down

0 comments on commit ab32e9e

Please sign in to comment.