Add a try: block to catch exceptions that occur before the main loop and to call ui.mainException().

I'm not sure if this is the "right" way to handle exceptions, but it does
correctly print the error message AFTER shutting down curses for me.
This commit is contained in:
Daniel Burrows 2006-12-01 11:59:22 +01:00
parent c7894a01f0
commit dc8f3c944d

View File

@ -101,6 +101,7 @@ def startup(versionno):
lock(config, ui) lock(config, ui)
try:
if options.has_key('-l'): if options.has_key('-l'):
sys.stderr = ui.logfile sys.stderr = ui.logfile
@ -149,6 +150,9 @@ def startup(versionno):
'config': config}) 'config': config})
t.setDaemon(1) t.setDaemon(1)
t.start() t.start()
except:
ui.mainException()
try: try:
threadutil.exitnotifymonitorloop(threadutil.threadexited) threadutil.exitnotifymonitorloop(threadutil.threadexited)
except SystemExit: except SystemExit: