node.js - nodejs uncaught exceptions after sending reponse -
node.js - nodejs uncaught exceptions after sending reponse -
i've restify server requests client parameters run long process.
so, after initializing attributes , checks, service returns json client (and start processing asynchronusly). client can monitor process via log files on sockets.
the problem exception before
res.send(jsonobject)
can caught by
process.on('uncaughtexception'...
but exception after sending response can't caught!!!
regardless handling exceptions way isn't best way , tailing on sockets isn't good
i want able grab later exceptions may occur after sending response client!!
perhaps should take @ this post regarding exception handling. when error bubbles uncaughtexception puts process in unknown state. if you'd instead isolate these exceptions consider using domains wrap logic safely.
per nodejs documentation: "note uncaughtexception rough mechanism exception handling , may removed in future.
don't utilize it, utilize domains instead. if utilize it, restart application after every unhandled exception!
do not utilize node.js equivalent of on error resume next. unhandled exception means application - , extension node.js - in undefined state. blindly resuming means happen.
think of resuming pulling powerfulness cord when upgrading system. 9 out of 10 times nil happens - 10th time, scheme bust.
you have been warned."
node.js asynchronous express exception-handling restify
Comments
Post a Comment