ircanywhere / irc-factory

A rebuilt irc-factory from simple-irc-socket and irc-message. Get support at #ircanywhere on freenode
https://ircanywhere.com
MIT License
60 stars 14 forks source link

process.on('uncaughtException') hook is bad #34

Open myndzi opened 8 years ago

myndzi commented 8 years ago

In api.js, you bind an uncaught exception handler. Not only is this bad practice for a library, it forces an exit, and with a successful error code which is even worse. This kind of handler should always be in the top level application, and it should certainly not override the behavior of what a parent application might specify. Fatally, it just silently exits the program if you don't know about or bind the event yourself, nor does it pass along the error object as-is. So many problems for a few lines of code!