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:
parent
c7894a01f0
commit
dc8f3c944d
@ -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:
|
||||||
|
Loading…
Reference in New Issue
Block a user