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:
Damien Elmes 2013-11-14 11:14:21 +09:00
parent f6b9dadf13
commit 8812472b53

View file

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