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>(
168168 sendReady,
169169
170170 async sendError ( error : Error ) : Promise < never > {
171+ let failed = false
171172 try {
172173 await send ( {
173174 type : 'error' ,
174175 ...structuredError ( error ) ,
175176 } )
176177 } catch ( err ) {
178+ // There's nothing we can do about errors that happen after this point, we can't tell anyone
179+ // about them.
177180 console . error ( 'failed to send error back to rust:' , err )
178- // ignore and exit anyway
179- process . exit ( 1 )
181+ failed = true
180182 }
181-
182- process . exit ( 0 )
183+ await new Promise < void > ( ( res ) => socket . end ( ( ) => res ( ) ) )
184+ process . exit ( failed ? 1 : 0 )
183185 } ,
184186 }
185187}
You can’t perform that action at this time.
0 commit comments