Commits

Yuki KODAMA  committed 81ea423

user: catch DownloadError when starting OAuth

  • Participants
  • Parent commits 9741742

Comments (0)

Files changed (1)

 class OAuthRedirectPage(webapp.RequestHandler):
 
     def get(self):
-        self.redirect(twitter.get_auth_url())
+        try:
+            self.redirect(twitter.get_auth_url())
+        except twitter.DownloadError:
+            logging.error("Couldn't start sign-in via Twitter")
+            return self.redirect('/signin?n=error')
 
 class CallbackPage(webapp.RequestHandler):