child_process: don't throw on EAGAIN
authorCharles <cydjudge@users.noreply.github.com>
Tue, 17 Jun 2014 22:44:11 +0000 (00:44 +0200)
committerFedor Indutny <fedor@indutny.com>
Tue, 24 Jun 2014 04:45:29 +0000 (08:45 +0400)
Signed-off-by: Fedor Indutny <fedor@indutny.com>
lib/child_process.js

index d6017d1..e2087c3 100644 (file)
@@ -1114,7 +1114,9 @@ ChildProcess.prototype.spawn = function(options) {
 
   var err = this._handle.spawn(options);
 
-  if (err === uv.UV_EMFILE ||
+  // Run-time errors should emit an error, not throw an exception.
+  if (err === uv.UV_EAGAIN ||
+      err === uv.UV_EMFILE ||
       err === uv.UV_ENFILE ||
       err === uv.UV_ENOENT) {
     process.nextTick(function() {