diff options
author | Arjen Hiemstra <ahiemstra@heimr.nl> | 2015-08-04 11:30:34 +0300 |
---|---|---|
committer | Arjen Hiemstra <ahiemstra@heimr.nl> | 2015-08-04 11:31:25 +0300 |
commit | 803b4fde8d552006eb230b06adc516fb0b7585ab (patch) | |
tree | d73ad34e7d05d7151742f0bf34c71c41ea1bac36 /cura_app.py | |
parent | cb066686283d7ba062dbd909555675e348a3f581 (diff) |
Handle all uncaught exceptions through CrashHandler and gracefully fail if we have no QCoreApplication
Diffstat (limited to 'cura_app.py')
-rwxr-xr-x | cura_app.py | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/cura_app.py b/cura_app.py index 35ea0375b6..4bd49dc081 100755 --- a/cura_app.py +++ b/cura_app.py @@ -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() |