From 240f61fd49deb7887df431dc677d4f8e8334c9fd Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Sun, 4 Dec 2011 19:10:26 +0900 Subject: [PATCH] catch timeout errors; blank key when badAuth received --- aqt/sync.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/aqt/sync.py b/aqt/sync.py index aeb299e1d..856daca8f 100755 --- a/aqt/sync.py +++ b/aqt/sync.py @@ -56,6 +56,9 @@ class SyncManager(QObject): tooltip( _("AnkiWeb ID or password was incorrect; please try again."), parent=self.mw) + # blank the key so we prompt user again + self.pm.profile['syncKey'] = None + self.pm.save() elif evt == "newKey": self.pm.profile['syncKey'] = args[0] self.pm.save() @@ -87,6 +90,10 @@ class SyncManager(QObject): return _("""\ Couldn't connect to AnkiWeb. Please check your network connection \ and try again.""") + elif "timed out" in err: + return _("""\ +The connection with the server timed out. Please check your network \ +connection and try again.""") return err def _getUserPass(self):