Skip to content

Commit

Permalink
feat(core): throw error when child_process is error exit
Browse files Browse the repository at this point in the history
  • Loading branch information
shanlan-L authored and why520crazy committed Sep 3, 2022
1 parent 7d74d7a commit 87b4a82
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/core/src/angular/site-builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,14 @@ export class SiteBuilder {
child.on('data', data => {
this.docgeni.logger.info(data);
});
child.on('exit', (code, signal) => {
if (code) {
throw new Error(`Child exited with code ${code}`);
}
if (signal) {
throw new Error(`Child was killed with signal ${signal}`);
}
});
} catch (error) {
this.docgeni.logger.error(error);
}
Expand Down

0 comments on commit 87b4a82

Please sign in to comment.