Flotype / now

NowJS makes it easy to build real-time web apps using JavaScript
http://www.nowjs.com
MIT License
1.91k stars 175 forks source link

Remove uncaughtException Handler in server.js #165

Open felixge opened 12 years ago

felixge commented 12 years ago

Please remove the uncaughtException handler in server.js:

https://github.com/Flotype/now/blob/master/lib/server.js#L4

Besides that a library should not try to become the global exception handler of my application, this is highly harmful as it may lead to applications going into a stale state because the stack was ripped in unexpected places.

The only sane way to deal with uncaught exceptions in node is to let the process die. (That's until we get Domains).

ericz commented 12 years ago

Hmm I understand that it is rather harmful to have the global uncaughtException handler, however there are currently insufficient validations to make sure no one user can bring down the entire server by providing very unexpected input. We'll continue to work on making sure input is validated so that a single user's actions don't trigger server crashes and then we can remove the uncaughtException handler. Resources for working on NowJS has been spread quite thin here which is why this has taken so long to be addressed, and for that I apologize.