fix(dev): stop stale frontend when portal exits
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
export function handleUnexpectedChildExit({
|
||||
label,
|
||||
code,
|
||||
signal,
|
||||
stopping,
|
||||
shutdown,
|
||||
log = console.error,
|
||||
}) {
|
||||
if (stopping) return false;
|
||||
|
||||
const detail = signal ? `signal ${signal}` : `code ${code ?? 'unknown'}`;
|
||||
const shutdownCode = Number.isInteger(code) && code > 0 ? code : 1;
|
||||
log(`[${label}] exited unexpectedly (${detail}); shutting down dev stack`);
|
||||
shutdown(shutdownCode);
|
||||
return true;
|
||||
}
|
||||
Reference in New Issue
Block a user