Skip to content

Commit

Permalink
Ensure error is logged when Closure fails
Browse files Browse the repository at this point in the history
  • Loading branch information
ian-craig committed Mar 26, 2021
1 parent 915ae0c commit af79925
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/closure-compiler-plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -968,10 +968,12 @@ class ClosureCompilerPlugin {

compilerProcess.on('close', (exitCode) => {
if (stdErrData instanceof Error) {
this.reportErrors({
this.reportErrors(compilation, [
{
level: 'error',
description: stdErrData.message,
});
}
]);
reject();
return;
}
Expand Down Expand Up @@ -1007,6 +1009,13 @@ class ClosureCompilerPlugin {

this.reportErrors(compilation, errors);
// TODO(ChadKillingsworth) Figure out how to report the stats
} else if (exitCode > 0) {
this.reportErrors(compilation, [
{
level: 'error',
description: `Closure compiler exited with code ${exitCode}.`,
}
]);
}

if (exitCode > 0) {
Expand Down

0 comments on commit af79925

Please sign in to comment.