commit 9b3cb4e1be26ae4a6967b0acd2dddf2093bf7e92 Author: Isis Lovecruft isis@torproject.org Date: Tue Oct 29 05:45:28 2013 +0000
Add better error handling if we cannot reach the Recaptcha server. --- lib/bridgedb/HTTPServer.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/lib/bridgedb/HTTPServer.py b/lib/bridgedb/HTTPServer.py index 1143675..ad76568 100644 --- a/lib/bridgedb/HTTPServer.py +++ b/lib/bridgedb/HTTPServer.py @@ -78,7 +78,10 @@ class CaptchaProtectedResource(twisted.web.resource.Resource): def render_GET(self, request): # get a captcha c = Raptcha(self.recaptchaPubKey, self.recaptchaPrivKey) - c.get() + try: + c.get() + except Exception as error: + log.error("Connection to Recaptcha server failed.")
# TODO: this does not work for versions of IE < 8.0 imgstr = 'data:image/jpeg;base64,%s' % base64.b64encode(c.image)
tor-commits@lists.torproject.org