mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 06:22:22 -04:00
catch "no such file or directory" error when connecting with no net
soren reports it happening on his computer; can't repro it here also make sure exception is always converted to string in reliable way
This commit is contained in:
parent
f6b9dadf13
commit
8812472b53
1 changed files with 3 additions and 6 deletions
|
@ -337,12 +337,9 @@ class SyncThread(QThread):
|
|||
ret = self.client.sync()
|
||||
except Exception, e:
|
||||
log = traceback.format_exc()
|
||||
try:
|
||||
err = unicode(e[0], "utf8", "ignore")
|
||||
except:
|
||||
# number, exception with no args, etc
|
||||
err = ""
|
||||
if "Unable to find the server" in err:
|
||||
err = repr(str(e))
|
||||
if ("Unable to find the server" in err or
|
||||
"Errno 2" in err):
|
||||
self.fireEvent("offline")
|
||||
else:
|
||||
if not err:
|
||||
|
|
Loading…
Reference in a new issue