From 74fdedba56cb75b0c62db7b5fb0f9d462cf040f1 Mon Sep 17 00:00:00 2001 From: Paul Gschwendtner Date: Wed, 26 Sep 2018 20:25:42 +0200 Subject: [PATCH] build: ts compilation not reporting failures (#13312) Currently if the TS compilation (either through `ngc` or `tsc`) fails, the gulp tasks won't report the error properly because the `reject()` call of the Promise does not have any error message. This causes compilation failures to be ignored. See: #13310 --- tools/package-tools/ts-compile.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/package-tools/ts-compile.ts b/tools/package-tools/ts-compile.ts index 3b856c1870e..382ee591f11 100644 --- a/tools/package-tools/ts-compile.ts +++ b/tools/package-tools/ts-compile.ts @@ -16,6 +16,8 @@ export function tsCompile(binary: 'tsc' | 'ngc', flags: string[]) { // Pipe stdout and stderr from the child process. childProcess.stdout.on('data', (data: string|Buffer) => console.log(`${data}`)); childProcess.stderr.on('data', (data: string|Buffer) => console.error(red(`${data}`))); - childProcess.on('exit', (exitCode: number) => exitCode === 0 ? resolve() : reject()); + childProcess.on('exit', (exitCode: number) => { + exitCode === 0 ? resolve() : reject(`${binary} compilation failure`); + }); }); }