File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
turbopack/crates/turbopack-node/js/src/ipc Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -168,18 +168,20 @@ function createIpc<TIncoming, TOutgoing>(
168
168
sendReady,
169
169
170
170
async sendError ( error : Error ) : Promise < never > {
171
+ let failed = false
171
172
try {
172
173
await send ( {
173
174
type : 'error' ,
174
175
...structuredError ( error ) ,
175
176
} )
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.
177
180
console . error ( 'failed to send error back to rust:' , err )
178
- // ignore and exit anyway
179
- process . exit ( 1 )
181
+ failed = true
180
182
}
181
-
182
- process . exit ( 0 )
183
+ await new Promise < void > ( ( res ) => socket . end ( ( ) => res ( ) ) )
184
+ process . exit ( failed ? 1 : 0 )
183
185
} ,
184
186
}
185
187
}
You can’t perform that action at this time.
0 commit comments