Merge pull request #616 from embark-framework/bug_fix/tell-pipeline-exited

log error when pipeline dies
This commit is contained in:
Iuri Matias 2018-07-11 09:42:08 +03:00 committed by GitHub
commit 908b51bc97
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 1 deletions

View File

@ -101,15 +101,25 @@ class Pipeline {
// JS files // JS files
async.waterfall([ async.waterfall([
function runWebpack(next) { function runWebpack(next) {
let built = false;
const webpackProcess = new ProcessLauncher({ const webpackProcess = new ProcessLauncher({
modulePath: utils.joinPath(__dirname, 'webpackProcess.js'), modulePath: utils.joinPath(__dirname, 'webpackProcess.js'),
logger: self.logger, logger: self.logger,
events: self.events events: self.events,
exitCallback: function (code) {
if (!built) {
return next(`File building of ${file.filename} exited with code ${code} before the process finished`);
}
if (code) {
self.logger(__('File building process exited with code ', code));
}
}
}); });
webpackProcess.send({action: constants.pipeline.init, options: {}}); webpackProcess.send({action: constants.pipeline.init, options: {}});
webpackProcess.send({action: constants.pipeline.build, file, importsList}); webpackProcess.send({action: constants.pipeline.build, file, importsList});
webpackProcess.once('result', constants.pipeline.built, (msg) => { webpackProcess.once('result', constants.pipeline.built, (msg) => {
built = true;
webpackProcess.kill(); webpackProcess.kill();
return next(msg.error); return next(msg.error);
}); });