mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 22:12:21 -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()
|
ret = self.client.sync()
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
log = traceback.format_exc()
|
log = traceback.format_exc()
|
||||||
try:
|
err = repr(str(e))
|
||||||
err = unicode(e[0], "utf8", "ignore")
|
if ("Unable to find the server" in err or
|
||||||
except:
|
"Errno 2" in err):
|
||||||
# number, exception with no args, etc
|
|
||||||
err = ""
|
|
||||||
if "Unable to find the server" in err:
|
|
||||||
self.fireEvent("offline")
|
self.fireEvent("offline")
|
||||||
else:
|
else:
|
||||||
if not err:
|
if not err:
|
||||||
|
|
Loading…
Reference in a new issue