Problem
The README promised errors never crash the process, but the remote emits error on a Node.js EventEmitter, and Node throws when error is emitted with no listener. A consumer that only listens for connect/key events crashes on the first connection or protocol error. The README now notes that you need an error listener (#41), but the library behaviour is still a trap.
Fix
Only emit error when a listener is attached (listenerCount("error") > 0). Otherwise route it to the debug/log channel, and surface it through the returned promise where an operation is pending. Test that an error with no listener doesn't throw and that one with a listener is delivered. Then remove the README caveat.
Problem
The README promised errors never crash the process, but the remote emits
erroron a Node.jsEventEmitter, and Node throws whenerroris emitted with no listener. A consumer that only listens for connect/key events crashes on the first connection or protocol error. The README now notes that you need anerrorlistener (#41), but the library behaviour is still a trap.Fix
Only emit
errorwhen a listener is attached (listenerCount("error") > 0). Otherwise route it to the debug/log channel, and surface it through the returned promise where an operation is pending. Test that an error with no listener doesn't throw and that one with a listener is delivered. Then remove the README caveat.