Skip to content

Commit 9321d4c

Browse files
devversionjelbourn
authored andcommitted
build: print error if prerender test fails (#18190)
Currently the errors are sometimes not printed if the prerendering test target fails. We fix this by always re-throwing the error at top-level. This also ensures that the process exits with a non-zero exit code.
1 parent 16159b3 commit 9321d4c

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/universal-app/prerender.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ result
2626
writeFileSync(filename, content, 'utf-8');
2727
console.log('Prerender done.');
2828
})
29-
// If rendering the module factory fails, exit the process with an error code because otherwise
30-
// the CI task will not recognize the failure and will show as "success". The error message
31-
// will be printed automatically by the `renderModuleFactory` method.
32-
.catch(() => process.exit(1));
29+
// If rendering the module factory fails, re-throw the error in order to print the
30+
// failure to the console, and to exit the process with a non-zero exit code.
31+
.catch(error => {
32+
throw error;
33+
});

0 commit comments

Comments
 (0)