dahquan / rattlesnake

An Open Source Slither.io Client Framework
MIT License
27 stars 16 forks source link

Different Socket error #93

Open rebrec opened 8 years ago

rebrec commented 8 years ago

When trying the feedme example, i am getting (depending of proxy good or not and sometimes server rejecting me) exceptions thrown that are uncaught.

events.js:141
      throw er; // Unhandled 'error' event
      ^

Error: tunneling socket could not be established, cause=socket hang up
    at ClientRequest.onError (/home/rebrec/rattlesnake/node_modules/tunnel/lib/tunnel.js:163:17)
    at ClientRequest.g (events.js:260:16)
    at emitOne (events.js:77:13)
    at ClientRequest.emit (events.js:169:7)
    at TLSSocket.socketErrorListener (_http_client.js:265:9)
    at emitOne (events.js:77:13)
    at TLSSocket.emit (events.js:169:7)
    at emitErrorNT (net.js:1256:8)
    at nextTickCallbackWith2Args (node.js:455:9)
    at process._tickCallback (node.js:369:17)

I have read that such errors can be caught using process.on('error', handler) or domains (which according to Node might be deprecated soon.

Does some of you have an advice on how to handle such behaviour ?

SrNicolas commented 8 years ago

Nah, its just a proxy that doesn't work, i don't remember where, but its replace throw new err replace with console.log

rebrec commented 8 years ago

i indeed guess that it is just a non working proxy, but what i wonder is how to catch the error ?