Closed schw4rzlicht closed 4 years ago
I've added a new "error"
event which is emitted. You can listen using
sACN.on('error', (err) => {
// trigged if there is an internal error (e.g. the supplied `iface` does not exist)
});
I prefer this paradigm over an async start()
method since this whole module is built around nodejs's EventEmitter.
When calling
new Receiver()
with an interface that doesn't exist,Socket.addMembership()
throwsError: addMembership EADDRNOTAVAIL
which is not catchable since it happens in the callback.Wouldn't it be a better idea to add a
start()
method toReceiver
which returns a promise so we could handle the error properly?