From 918d8c990904b35ba67ea60c4b985f22fab1e853 Mon Sep 17 00:00:00 2001 From: Pete Bacon Darwin Date: Wed, 18 Dec 2019 14:03:05 +0000 Subject: [PATCH] refactor(ngcc): slightly improve the info in error messages (#34254) PR Close #34254 --- packages/compiler-cli/ngcc/src/main.ts | 2 +- packages/compiler-cli/ngcc/test/integration/ngcc_spec.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/compiler-cli/ngcc/src/main.ts b/packages/compiler-cli/ngcc/src/main.ts index 793f637a87..5d6f232635 100644 --- a/packages/compiler-cli/ngcc/src/main.ts +++ b/packages/compiler-cli/ngcc/src/main.ts @@ -271,7 +271,7 @@ export function mainNgcc( const errors = replaceTsWithNgInErrors( ts.formatDiagnosticsWithColorAndContext(result.diagnostics, bundle.src.host)); throw new Error( - `Failed to compile entry-point ${entryPoint.name} due to compilation errors:\n${errors}`); + `Failed to compile entry-point ${entryPoint.name} (${formatProperty} as ${format}) due to compilation errors:\n${errors}`); } logger.debug(` Successfully compiled ${entryPoint.name} : ${formatProperty}`); diff --git a/packages/compiler-cli/ngcc/test/integration/ngcc_spec.ts b/packages/compiler-cli/ngcc/test/integration/ngcc_spec.ts index cd2311c11a..d571f16952 100644 --- a/packages/compiler-cli/ngcc/test/integration/ngcc_spec.ts +++ b/packages/compiler-cli/ngcc/test/integration/ngcc_spec.ts @@ -797,7 +797,7 @@ runInEachFileSystem(() => { fail('should have thrown'); } catch (e) { expect(e.message).toContain( - 'Failed to compile entry-point fatal-error due to compilation errors:'); + 'Failed to compile entry-point fatal-error (es2015 as esm2015) due to compilation errors:'); expect(e.message).toContain('NG2001'); expect(e.message).toContain('component is missing a template'); }