Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions turbopack/crates/turbopack-node/js/src/ipc/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,18 +168,20 @@ function createIpc<TIncoming, TOutgoing>(
sendReady,

async sendError(error: Error): Promise<never> {
let failed = false
try {
await send({
type: 'error',
...structuredError(error),
})
} catch (err) {
// There's nothing we can do about errors that happen after this point, we can't tell anyone
// about them.
console.error('failed to send error back to rust:', err)
// ignore and exit anyway
process.exit(1)
failed = true
}

process.exit(0)
await new Promise<void>((res) => socket.end(() => res()))
process.exit(failed ? 1 : 0)
},
}
}
Expand Down
Loading