Report unhandled exceptions via log_error() as well

This commit is contained in:
Kovid Goyal 2018-03-05 10:28:33 +05:30
parent 54ed08c24e
commit a0df5b970b
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -19,7 +19,7 @@ from .fast_data_types import (
) )
from .fonts.box_drawing import set_scale from .fonts.box_drawing import set_scale
from .utils import ( from .utils import (
detach, end_startup_notification, init_startup_notification, detach, end_startup_notification, init_startup_notification, log_error,
single_instance single_instance
) )
from .window import load_shader_programs from .window import load_shader_programs
@ -93,7 +93,7 @@ def setup_profiling(args):
print('To view the graphical call data, use: kcachegrind', cg) print('To view the graphical call data, use: kcachegrind', cg)
def main(): def _main():
try: try:
sys.setswitchinterval(1000.0) # we have only a single python thread sys.setswitchinterval(1000.0) # we have only a single python thread
except AttributeError: except AttributeError:
@ -157,3 +157,13 @@ def main():
signal.signal(signal.SIGCHLD, signal.SIG_DFL) signal.signal(signal.SIGCHLD, signal.SIG_DFL)
finally: finally:
glfw_terminate() glfw_terminate()
def main():
try:
_main()
except Exception:
import traceback
tb = traceback.format_exc()
log_error(tb)
raise SystemExit(1)