Guard plugin worker error emission

This commit is contained in:
Dotta committed 2026-05-19 14:25:17 -05:00
1 parent d5fe07586f
commit 080060ba42
1 file changed
+3 -1
+3 -1
View File
@@ -653,7 +653,9 @@ export function createPluginWorkerHandle(
// Handle process errors (e.g. spawn failure)
child.on("error", (err) => {
log.error({ err: err.message }, "worker process error");
emitter.emit("error", { pluginId, error: err });
if (emitter.listenerCount("error") > 0) {
emitter.emit("error", { pluginId, error: err });
}
if (status === "starting") {
setStatus("crashed");
rejectAllPending(