const dgram = require('dgram');
const assert = require('assert');
const util = require('util');
+const debug = util.debuglog('child_process');
const Process = process.binding('process_wrap').Process;
const WriteWrap = process.binding('stream_wrap').WriteWrap;
var options = opts.options;
var child = new ChildProcess();
+ debug('spawn', opts.args, options);
+
child.spawn({
file: opts.file,
args: opts.args,
if (self.spawnfile)
err.path = self.spawnfile;
+ err.spawnargs = self.spawnargs.slice(1);
self.emit('error', err);
} else {
self.emit('exit', self.exitCode, self.signalCode);
}
this.spawnfile = options.file;
+ this.spawnargs = options.args;
var err = this._handle.spawn(options);
var i;
+ debug('spawnSync', opts.args, options);
+
options.file = opts.file;
options.args = opts.args;
options.envPairs = opts.envPairs;
result.stdout = result.output && result.output[1];
result.stderr = result.output && result.output[2];
- if (result.error)
- result.error = errnoException(result.error, 'spawnSync');
+ if (result.error) {
+ result.error = errnoException(result.error, 'spawnSync ' + opts.file);
+ result.error.path = opts.file;
+ result.error.spawnargs = opts.args.slice(1);
+ }
util._extend(result, opts);