diff options
author | Joao Moreno <jomo@microsoft.com> | 2017-01-13 11:12:06 +0300 |
---|---|---|
committer | Joao Moreno <jomo@microsoft.com> | 2017-01-13 11:12:06 +0300 |
commit | 5ba8940d62497fbe5b5f0c84f4cc4113205d0048 (patch) | |
tree | 70c5303df7868895b8aead16ecfa862ae399dfd3 /gulpfile.js | |
parent | 2cdc2b3da8f0fd5322b48747241584cf9dd98f8f (diff) |
catch unhandled promise rejections in build
Diffstat (limited to 'gulpfile.js')
-rw-r--r-- | gulpfile.js | 6 |
1 files changed, 6 insertions, 0 deletions
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`); |