discordjs / RPC

A simple RPC client for Discord
MIT License
467 stars 192 forks source link

Write before register error handler will cause the node.js process to panic when write failed #35

Closed mmis1000 closed 6 years ago

mmis1000 commented 6 years ago

https://github.com/discordjs/RPC/blob/9344703f247350470c3472d24ffb5a0950287428/src/transports/IPC.js#L57-L58

The error handler should be added before any operation that may cause the EventEmitter to throw.
Otherwise, a uncaught error will panic the whole node.js process.