3 ms·
C++ - couldn't you just put a catch(...) within your request handler and return 500 if that is hit?
by 72deluxe 12y ago
C++ - couldn't you just put a catch(...) within your request handler and return 500 if that is hit?
- toxicFork 12y agoAnd you can do the same on node :)
- deleted 12y ago[deleted]
- esailija 12y agonot 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.
- bitg 12y agoYes 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).
- 72deluxe 12y agoStops the entire process dying though, so you can keep on serving?