Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Ultimaker/Cura.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksei S <a.sasin@ultimaker.com>2018-12-06 15:41:50 +0300
committerAleksei S <a.sasin@ultimaker.com>2018-12-06 15:41:50 +0300
commite8cf9e034db4bf232f29171908e144d6455f0936 (patch)
tree1c09bb0a5275d4fc98480d1fa32b8798f677814c /cura/CrashHandler.py
parent84c85439ff4db4db77eecc1657fcd78634eca16e (diff)
Catch All Exception except: SystemExit, KeyboardInterrupt, GeneratorException
CURA-5939
Diffstat (limited to 'cura/CrashHandler.py')
-rw-r--r--cura/CrashHandler.py20
1 files changed, 8 insertions, 12 deletions
diff --git a/cura/CrashHandler.py b/cura/CrashHandler.py
index 46544ca0ef..d43743bc37 100644
--- a/cura/CrashHandler.py
+++ b/cura/CrashHandler.py
@@ -36,18 +36,14 @@ else:
except ImportError:
CuraDebugMode = False # [CodeStyle: Reflecting imported value]
-# List of exceptions that should be considered "fatal" and abort the program.
-# These are primarily some exception types that we simply cannot really recover from
-# (MemoryError and SystemError) and exceptions that indicate grave errors in the
-# code that cause the Python interpreter to fail (SyntaxError, ImportError).
-fatal_exception_types = [
- MemoryError,
- SyntaxError,
- ImportError,
- SystemError,
+# List of exceptions that should not be considered "fatal" and abort the program.
+# These are primarily some exception types that we simply skip
+skip_exception_types = [
+ SystemExit,
+ KeyboardInterrupt,
+ GeneratorExit
]
-
class CrashHandler:
crash_url = "https://stats.ultimaker.com/api/cura"
@@ -70,7 +66,7 @@ class CrashHandler:
# If Cura has fully started, we only show fatal errors.
# If Cura has not fully started yet, we always show the early crash dialog. Otherwise, Cura will just crash
# without any information.
- if has_started and exception_type not in fatal_exception_types:
+ if has_started and exception_type in skip_exception_types:
return
if not has_started:
@@ -387,7 +383,7 @@ class CrashHandler:
Application.getInstance().callLater(self._show)
def _show(self):
- # When the exception is not in the fatal_exception_types list, the dialog is not created, so we don't need to show it
+ # When the exception is in the skip_exception_types list, the dialog is not created, so we don't need to show it
if self.dialog:
self.dialog.exec_()
os._exit(1)