Skip to content

Commit

Permalink
fix(cli): display error when plugin throw an error during serve starting
Browse files Browse the repository at this point in the history
  • Loading branch information
LingyuCoder committed Oct 28, 2024
1 parent 6e62fa2 commit cd1b7d7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/rspack-cli/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ export class RspackCLI {
this.getLogger().error(e.message);
process.exit(2);
} else if (e instanceof Error) {
if (callback) {
callback?.(e);
if (typeof callback === "function") {
callback(e);
} else {
this.getLogger().error(e);
}
Expand Down

0 comments on commit cd1b7d7

Please sign in to comment.