Error Message
node.js:63
throw e;
^
Error: ECONNRESET, Connection reset by peer
at Stream._readImpl (net:304:14)
at IOWatcher.callback (net:454:24)
at node.js:768:9
The error 'ECONNRESET, Connection reset by peer' like the above is thrown when a connection was forcibly closed by peer. For example, a sudden lost of connection due to unstable network environment or unexpected crash of a browser, etc.
If such exception bubbles all the way back to event loop, the node process print a stack trace and exit as the default action. Try/catch blocks can't catch the excption which occurs in event loop.
To prevent these errors from crashing down your node server, please use
process.on('uncaughtException', function (err) {
// handle the error
});
Reference
[nodejs.org] Event: 'uncautException'
[nodejs@googlegroups.com] How to prevent node from dying on error?
[technet.microsoft.com] Connection reset by peer
http://technet.microsoft.com/en-us/library/cc957018.aspx
node.js - Dealing with uncaught exceptions
http://debuggable.com/posts/node-js-dealing-with-uncaught-exceptions:4c933d54-1428-443c-928d-4e1ecbdd56cb
node.js - Dealing with uncaught exceptions
http://debuggable.com/posts/node-js-dealing-with-uncaught-exceptions:4c933d54-1428-443c-928d-4e1ecbdd56cb
0 件のコメント:
コメントを投稿