Open ferm10n opened 2 years ago
Additionally, I think that SessionControlClient should be modified to emit an error when calling close() with an error.
I tried removing the _destroy() noop mentioned above, but still didn't get an error.
Adding an emit('error')
is easy enough in the close() method before emit('close')
but does it makes sense? Would appreciate some input.
I'm discovering that if there's an error during parsing, MidParser does not emit it, and the stream is silently destroyed. This might be caused by something I did while tinkering with the project, but it'd really help if I had some context about this section:
https://github.com/st-one-io/node-open-protocol/blob/f514d00d5ddc7b0d84f222c2e481e2a07cf16c91/src/MIDParser.js#L71-L73
It seems to be responsible for why the error gets eaten. If I remove it, the default handler emits the error event correctly.
How did earlier versions of node behave that prompted _destroy() to become a noop? I'd like to fix this without breaking backwards compat, but can't do that without more history on why it was added.
(I'm using node v14 btw)