1
0
mirror of https://github.com/OfflineIMAP/offlineimap.git synced 2024-06-29 07:50:51 +02:00

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:
Sebastian Spaeth 2011-08-22 11:49:57 +02:00
parent 0d95651417
commit 19ff636390
2 changed files with 2 additions and 9 deletions

View File

@ -347,7 +347,8 @@ class OfflineImap:
except (SystemExit):
raise
except Exception, e:
ui.mainException()
ui.error(e)
ui.terminate()
def sync_singlethreaded(self, accs, config):
"""Executed if we do not want a separate syncmaster thread

View File

@ -344,14 +344,6 @@ class UIBase:
s.delThreadDebugLog(thread)
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):
"""Called to terminate the application."""
#print any exceptions that have occurred over the run