node-socksified
node-socksified copied to clipboard
how to catch "SOCKS connection failed" exceptions?
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
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)