fix(docs-infra): exit with an error when cleaning up the preview server fails (#36837)

Previously, when the preview server `build-cleanup` script failed, the
error was logged but not reflected to the commands exit code. This seems
to have been accidentally broken in #23576.

This commit fixes it by ensuring the error is re-thrown from the
`BuildCleaner#cleanUp()` method to allow the process to exit with an
error exit code.

PR Close #36837
This commit is contained in:
George Kalpakas
2020-05-02 16:17:48 +03:00
committed by Alex Rickabaugh
parent a25c3c5c3b
commit a5d1d1161b
2 changed files with 11 additions and 30 deletions

View File

@ -35,6 +35,7 @@ export class BuildCleaner {
]);
} catch (error) {
this.logger.error('ERROR:', error);
throw error;
}
}