News for hackers. Stuff that matters.
Re:Gotchas from Two Years with Node by 72deluxe on Tuesday April 14, 2015 @04:35AM (#9372866)
C++ - couldn't you just put a catch(...) within your request handler and return 500 if that is hit?
Re:Gotchas from Two Years with Node by bitg on Tuesday April 14, 2015 @12:23PM (#9375358)
Yes you can do a global catch, but the error still happened, the functionality was faulty and you didn't handle it properly (you just showed the error, period).
Re:Gotchas from Two Years with Node by 72deluxe on Tuesday April 21, 2015 @05:44AM (#9413010)
Stops the entire process dying though, so you can keep on serving?
Re:Gotchas from Two Years with Node by toxicFork on Tuesday April 14, 2015 @04:36AM (#9372870)
And you can do the same on node :)
Re:Gotchas from Two Years with Node by esailija on Tuesday April 14, 2015 @11:09AM (#9374824)
not if you are using any kind of event emitters. These don't participate in any kind of flow but fire "error" events as side effect sneakily in the background, and if there is no listener on an event emitter for the "error" event, it will crash the server. And almost everything in core is an event emitter.

Also bonus points if the event emitter object is private to some module that doesn't expose it and doesn't attach an "error" event handler to it.