Skip to content

Commit

Permalink
make sure to exit the process in case of errors during errors sending (
Browse files Browse the repository at this point in the history
  • Loading branch information
sokra committed Oct 28, 2022
1 parent 2af748e commit 69d98a5
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions packages/next-swc/crates/next-core/js/src/internal/ipc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,14 @@ function createIpc<TIncoming, TOutgoing>(
},

async sendError(error: Error): Promise<never> {
await send({
type: "error",
...structuredError(error),
});
try {
await send({
type: "error",
...structuredError(error),
});
} catch (err) {
// ignore and exit anyway
}
process.exit(1);
},
};
Expand Down

0 comments on commit 69d98a5

Please sign in to comment.