mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-09-15 11:22:15 +03:00
child.on("error") was manually calling controller.close() without
setting the finished flag, so the subsequent child.on("close") event
for the same failed spawn saw finished=false and called finish() ->
emit() -> controller.enqueue() on an already-closed controller,
throwing an uncaughtException. Route the error handler through the
existing finish(msg) helper, which already guards on finished, so the
error still reaches the client as a sanitized SSE error event exactly
once.