mirror of
https://github.com/ankitects/anki.git
synced 2025-09-20 23:12:21 -04:00
on an unknown error, print full traceback. ensure .data exists
This commit is contained in:
parent
5b14d882e7
commit
52139646dc
1 changed files with 3 additions and 1 deletions
|
@ -36,6 +36,8 @@ class Sync(QThread):
|
||||||
self.syncDeck()
|
self.syncDeck()
|
||||||
|
|
||||||
def error(self, error):
|
def error(self, error):
|
||||||
|
if getattr(error, 'data', None) is None:
|
||||||
|
error.data = {}
|
||||||
if error.data.get('type') == 'noResponse':
|
if error.data.get('type') == 'noResponse':
|
||||||
self.emit(SIGNAL("noSyncResponse"))
|
self.emit(SIGNAL("noSyncResponse"))
|
||||||
else:
|
else:
|
||||||
|
@ -53,7 +55,7 @@ class Sync(QThread):
|
||||||
elif error.data.get('status') == "oldVersion":
|
elif error.data.get('status') == "oldVersion":
|
||||||
msg=_("The sync protocol has changed. Please upgrade.")
|
msg=_("The sync protocol has changed. Please upgrade.")
|
||||||
else:
|
else:
|
||||||
msg=_("Unknown error: %s" % `getattr(error, 'data')`)
|
msg=_("Unknown error: %s" % traceback.format_exc())
|
||||||
return msg
|
return msg
|
||||||
|
|
||||||
def connect(self, *args):
|
def connect(self, *args):
|
||||||
|
|
Loading…
Reference in a new issue