From 5ba8940d62497fbe5b5f0c84f4cc4113205d0048 Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Fri, 13 Jan 2017 09:12:06 +0100 Subject: catch unhandled promise rejections in build --- gulpfile.js | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'gulpfile.js') diff --git a/gulpfile.js b/gulpfile.js index f82bdbf2bb5..70aab71c296 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -58,8 +58,14 @@ var ALL_EDITOR_TASKS = [ 'tslint', 'hygiene', ]; + var runningEditorTasks = process.argv.length > 2 && process.argv.slice(2).every(function (arg) { return (ALL_EDITOR_TASKS.indexOf(arg) !== -1); }); +process.on('unhandledRejection', (reason, p) => { + console.log('Unhandled Rejection at: Promise', p, 'reason:', reason); + process.exit(1); +}); + if (runningEditorTasks) { require(`./build/gulpfile.editor`); require(`./build/gulpfile.hygiene`); -- cgit v1.2.3