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