|
|
|
@ -289,6 +289,12 @@ Compile.prototype.exec = function (command, args, options) {
|
|
|
|
|
streams.stderr += "\nKilled - processing time exceeded";
|
|
|
|
|
}, timeoutMs);
|
|
|
|
|
|
|
|
|
|
function setupOnError(stream, name) {
|
|
|
|
|
stream.on('error', function (err) {
|
|
|
|
|
logger.error('Error with ' + name + ' stream:', err);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function setupStream(stream, name) {
|
|
|
|
|
stream.on('data', function (data) {
|
|
|
|
|
if (streams.truncated) return;
|
|
|
|
@ -300,11 +306,10 @@ Compile.prototype.exec = function (command, args, options) {
|
|
|
|
|
}
|
|
|
|
|
streams[name] += data;
|
|
|
|
|
});
|
|
|
|
|
stream.on('error', function (err) {
|
|
|
|
|
logger.error('Error with stream:', err);
|
|
|
|
|
});
|
|
|
|
|
setupOnError(stream, name);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
setupOnError(child.stdin, 'stdin');
|
|
|
|
|
setupStream(child.stdout, 'stdout');
|
|
|
|
|
setupStream(child.stderr, 'stderr');
|
|
|
|
|
child.on('exit', function (code) {
|
|
|
|
|