Skip to content

Commit

Permalink
Log output when onError set (ampproject#34259)
Browse files Browse the repository at this point in the history
  • Loading branch information
rcebulko authored and rochapablo committed Aug 30, 2021
1 parent cf4eddc commit ead104a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion build-system/tasks/check-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit ead104a

Please sign in to comment.