Added Tor error handling