Handle all uncaught exceptions through CrashHandler and gracefully fail if we have no QCoreApplication

This commit is contained in:
Arjen Hiemstra 2015-08-04 10:30:34 +02:00
parent cb06668628
commit 803b4fde8d
2 changed files with 18 additions and 9 deletions

View file

@ -3,12 +3,15 @@
# Copyright (c) 2015 Ultimaker B.V.
# Cura is released under the terms of the AGPLv3 or higher.
try:
import cura.CuraApplication
import sys
app = cura.CuraApplication.CuraApplication.getInstance()
app.run()
except Exception as e:
def exceptHook(type, value, traceback):
import cura.CrashHandler
cura.CrashHandler.show()
cura.CrashHandler.show(type, value, traceback)
sys.excepthook = exceptHook
import cura.CuraApplication
app = cura.CuraApplication.CuraApplication.getInstance()
app.run()