main.py: Handle uncaught exception with sys.excepthook