After the uv upgrade, uv_spawn will now fail faster for certain
failures like ENOENT. However, our tests and other people may be
depending on that error being passed to the callback instead of a
throw.
var err = this._handle.spawn(options);
- if (err) {
+ if (!constants)
+ constants = process.binding('constants');
+
+ if (-err == constants.ENOENT) {
+ process.nextTick(function() {
+ self._handle.onexit(err);
+ });
+ } else if (err) {
// Close all opened fds on error
stdio.forEach(function(stdio) {
if (stdio.type === 'pipe') {