Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/microsoft/vscode.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoao Moreno <jomo@microsoft.com>2017-01-13 11:12:06 +0300
committerJoao Moreno <jomo@microsoft.com>2017-01-13 11:12:06 +0300
commit5ba8940d62497fbe5b5f0c84f4cc4113205d0048 (patch)
tree70c5303df7868895b8aead16ecfa862ae399dfd3
parent2cdc2b3da8f0fd5322b48747241584cf9dd98f8f (diff)
catch unhandled promise rejections in build
-rw-r--r--build/gulpfile.hygiene.js5
-rw-r--r--gulpfile.js6
2 files changed, 11 insertions, 0 deletions
diff --git a/build/gulpfile.hygiene.js b/build/gulpfile.hygiene.js
index 0ca8ea54b9d..f53a1c1bd26 100644
--- a/build/gulpfile.hygiene.js
+++ b/build/gulpfile.hygiene.js
@@ -229,6 +229,11 @@ gulp.task('hygiene', () => hygiene());
if (require.main === module) {
const cp = require('child_process');
+ process.on('unhandledRejection', (reason, p) => {
+ console.log('Unhandled Rejection at: Promise', p, 'reason:', reason);
+ process.exit(1);
+ });
+
cp.exec('git config core.autocrlf', (err, out) => {
const skipEOL = out.trim() === 'true';
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`);