node-socksified icon indicating copy to clipboard operation
node-socksified copied to clipboard

how to catch "SOCKS connection failed" exceptions?

Open 0xgeert opened this issue 12 years ago • 1 comments
trafficstars

There happen in SocksClientSocket.prototype.connect_socks_to_host and there's no way to add exception handlers to a socket since it isn't exposed (afaik)

i.e: socket.on('error',function(err){}) doesn't work since I don't know how to get to socket.

Any way how to do this?

Obvisouly, I don't want to do process.on('uncaughtException', function (err) {} since this is completely out of context

0xgeert avatar Jul 01 '13 14:07 0xgeert

One solution could be (at first glance) have all thrown errors in socks_socket be changed to self.emit('error',error); Not sure what the reason was for throwing to be honest since we're talking async stuff etc, so how would you ever catch them? (honest question, I might be missing something)

0xgeert avatar Jul 01 '13 15:07 0xgeert