unhandled exception if socket closes and 'error' is emitted#105
Merged
einaros merged 1 commit intowebsockets:masterfrom Oct 1, 2012
Merged
unhandled exception if socket closes and 'error' is emitted#105einaros merged 1 commit intowebsockets:masterfrom
einaros merged 1 commit intowebsockets:masterfrom
Conversation
Contributor
|
Hmm, I'll dig into this shortly. Sorry for the delay - vacation time and such :) |
einaros
added a commit
that referenced
this pull request
Oct 1, 2012
unhandled exception if socket closes and 'error' is emitted
|
I have a similar error. Up to date on npm. Was this ever fixed and what is causing this ?? How can it be handled. Error: connect ECONNABORTED 192.168.137.27:80 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The following stack trace shows the exception thrown if the socket fails with ECONNABORTED.
Gist that reproduces the error: https://gist.github.com/3219285
I'm not 100% confident that this fix is in the right place. The uncaught exception appears to be from an unhandled 'error' event from eventemitter. This can occur if Socket._write (net.js:558:19) fails and Socket::_destroy() is called. If there is no callback specified to Socket::_destroy, then the 'error' event is emitted on next tick, which also bypasses any immediate try/catch blocks in Sender::frameAndSend().
events.js:66
throw arguments[1]; // Unhandled 'error' event
^
Error: write ECONNABORTED
at errnoException (net.js:782:11)
at Socket._write (net.js:558:19)
at Socket.write (net.js:517:15)
at Sender.frameAndSend (c:\mydir\node-ws-exception\node_modules\ws\lib\Sender.js:146:22)
at Sender.close (c:\mydir\node-ws-exception\node_modules\ws\lib\Sender.js:43:8)
at WebSocket.close (c:\mydir\node-ws-exception\node_modules\ws\lib\WebSocket.js:89:18)
at Timer. (c:\mydir\node-ws-exception\client.js:35:20)
at Timer.exports.setInterval.timer.ontimeout (timers.js:234:14)