Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悰 Log output when onError set #34259

Merged
merged 4 commits into from
May 6, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 8 additions & 1 deletion build-system/tasks/check-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -283,13 +283,20 @@ async function typeCheck(targetName) {
return;
}

if (target.onError) {
// If an onError handler is defined, steal the output and log it manually.
rcebulko marked this conversation as resolved.
Show resolved Hide resolved
opts.logger = (m) => {
errorMsg = m;
log(m);
rcebulko marked this conversation as resolved.
Show resolved Hide resolved
};
}

let errorMsg;
rcebulko marked this conversation as resolved.
Show resolved Hide resolved
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