We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e11e87a commit 26d61f1Copy full SHA for 26d61f1
1 file changed
turbopack/crates/turbopack-node/js/src/ipc/index.ts
@@ -168,18 +168,20 @@ function createIpc<TIncoming, TOutgoing>(
168
sendReady,
169
170
async sendError(error: Error): Promise<never> {
171
+ let failed = false
172
try {
173
await send({
174
type: 'error',
175
...structuredError(error),
176
})
177
} catch (err) {
178
+ // There's nothing we can do about errors that happen after this point, we can't tell anyone
179
+ // about them.
180
console.error('failed to send error back to rust:', err)
- // ignore and exit anyway
- process.exit(1)
181
+ failed = true
182
}
-
- process.exit(0)
183
+ await new Promise<void>((res) => socket.end(() => res()))
184
+ process.exit(failed ? 1 : 0)
185
},
186
187
0 commit comments