Properly output errors when the main thread receives some
Use the ui.error infrastructure that has been put in place and use ui.terminate even if we received an Exception, so that we can output the list of errors that we have. This does away with 2 now unused functions in ui/UIBase.py Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
This commit is contained in:
parent
0d95651417
commit
19ff636390
@ -347,7 +347,8 @@ class OfflineImap:
|
|||||||
except (SystemExit):
|
except (SystemExit):
|
||||||
raise
|
raise
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
ui.mainException()
|
ui.error(e)
|
||||||
|
ui.terminate()
|
||||||
|
|
||||||
def sync_singlethreaded(self, accs, config):
|
def sync_singlethreaded(self, accs, config):
|
||||||
"""Executed if we do not want a separate syncmaster thread
|
"""Executed if we do not want a separate syncmaster thread
|
||||||
|
@ -344,14 +344,6 @@ class UIBase:
|
|||||||
s.delThreadDebugLog(thread)
|
s.delThreadDebugLog(thread)
|
||||||
s.terminate(100)
|
s.terminate(100)
|
||||||
|
|
||||||
def getMainExceptionString(s):
|
|
||||||
return "Main program terminated with exception:\n%s\n" %\
|
|
||||||
traceback.format_exc() + \
|
|
||||||
s.getThreadDebugLog(threading.currentThread())
|
|
||||||
|
|
||||||
def mainException(s):
|
|
||||||
s._msg(s.getMainExceptionString())
|
|
||||||
|
|
||||||
def terminate(self, exitstatus = 0, errortitle = None, errormsg = None):
|
def terminate(self, exitstatus = 0, errortitle = None, errormsg = None):
|
||||||
"""Called to terminate the application."""
|
"""Called to terminate the application."""
|
||||||
#print any exceptions that have occurred over the run
|
#print any exceptions that have occurred over the run
|
||||||
|
Loading…
Reference in New Issue
Block a user