From ead104ad9c60a97e63d7c1dffb2ff95f6d27cdc9 Mon Sep 17 00:00:00 2001 From: Ryan Cebulko Date: Thu, 6 May 2021 14:35:29 -0400 Subject: [PATCH] Log output when onError set (#34259) --- build-system/tasks/check-types.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/build-system/tasks/check-types.js b/build-system/tasks/check-types.js index 4a86ab41ef58e..96a80270fce43 100644 --- a/build-system/tasks/check-types.js +++ b/build-system/tasks/check-types.js @@ -284,12 +284,17 @@ async function typeCheck(targetName) { } let errorMsg; + if (target.onError) { + // If an onError handler is defined, steal the output and let onError handle + // logging + opts.logger = (m) => (errorMsg = m); + } + await closureCompile(entryPoints, './dist', `${targetName}-check-types.js`, { noAddDeps, include3pDirectories: !noAddDeps, includePolyfills: !noAddDeps, typeCheckOnly: true, - logger: (m) => (errorMsg = m), ...opts, }).catch((error) => { if (!target.onError) {