catch timeout errors; blank key when badAuth received

This commit is contained in:
Damien Elmes 2011-12-04 19:10:26 +09:00
parent 7916dea182
commit 240f61fd49

View file

@ -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):