mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-10-23 09:07:46 +02:00
Guard plugin worker error emission
This commit is contained in:
1 parent
d5fe07586f
commit
080060ba42
1 file changed
+3
-1
@@ -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(
|
||||
|
||||
Reference in new issue
Block a user