src/eric7/Debugger/DebugUI.py

branch
eric7
changeset 10321
4a017fdf316f
parent 10306
904f4c7da759
child 10415
af9a6dac2611
--- a/src/eric7/Debugger/DebugUI.py	Fri Nov 17 17:53:14 2023 +0100
+++ b/src/eric7/Debugger/DebugUI.py	Sat Nov 18 15:18:17 2023 +0100
@@ -100,12 +100,6 @@
         self.excIgnoreList = Preferences.toList(
             Preferences.getSettings().value("DebugInfo/IgnoredExceptions")
         )
-        self.exceptions = Preferences.toBool(
-            Preferences.getSettings().value("DebugInfo/ReportExceptions", True)
-        )
-        self.unhandledExceptions = Preferences.toBool(
-            Preferences.getSettings().value("DebugInfo/ReportUnhandledExceptions", True)
-        )
         self.autoClearShell = Preferences.toBool(
             Preferences.getSettings().value("DebugInfo/AutoClearShell", True)
         )
@@ -115,6 +109,9 @@
         self.autoContinue = Preferences.toBool(
             Preferences.getSettings().value("DebugInfo/AutoContinue", True)
         )
+        self.reportAllExceptions = Preferences.toBool(
+            Preferences.getSettings().value("DebugInfo/ReportAllExceptions", False)
+        )
         self.enableMultiprocess = Preferences.toBool(
             Preferences.getSettings().value("DebugInfo/EnableMultiprocess", False)
         )
@@ -964,17 +961,14 @@
                 self.envHistory.remove(envStr)
             self.envHistory.insert(0, envStr)
 
-    def setExceptionReporting(self, exceptions, unhandledExceptions=True):
+    def setExceptionReporting(self, reportAllExceptions):
         """
         Public slot to initialize the exception reporting flag.
 
-        @param exceptions flag indicating exception reporting status
-        @type bool
-        @param unhandledExceptions flag indicating to always report unhandled exceptions
+        @param reportAllExceptions flag indicating to report all exceptions
         @type bool
         """
-        self.exceptions = exceptions
-        self.unhandledExceptions = unhandledExceptions
+        self.reportAllExceptions = reportAllExceptions
 
     def setExcList(self, excList):
         """
@@ -1186,17 +1180,14 @@
             "DebugInfo/IgnoredExceptions", self.excIgnoreList
         )
         Preferences.getSettings().setValue(
-            "DebugInfo/ReportExceptions", self.exceptions
-        )
-        Preferences.getSettings().setValue(
-            "DebugInfo/ReportUnhandledExceptions", self.unhandledExceptions
-        )
-        Preferences.getSettings().setValue(
             "DebugInfo/AutoClearShell", self.autoClearShell
         )
         Preferences.getSettings().setValue("DebugInfo/TracePython", self.tracePython)
         Preferences.getSettings().setValue("DebugInfo/AutoContinue", self.autoContinue)
         Preferences.getSettings().setValue(
+            "DebugInfo/ReportAllExceptions", self.reportAllExceptions
+        )
+        Preferences.getSettings().setValue(
             "DebugInfo/EnableMultiprocess", self.enableMultiprocess
         )
         Preferences.getSettings().setValue(
@@ -1434,10 +1425,10 @@
             return
 
         if (
-            self.exceptions
+            self.reportAllExceptions
             and exceptionType not in self.excIgnoreList
             and (len(self.excList) == 0 or exceptionType in self.excList)
-        ) or (self.unhandledExceptions and exceptionType.startswith("unhandled")):
+        ) or exceptionType.startswith("unhandled"):
             res = None
             if stackTrace:
                 with contextlib.suppress(UnicodeError, OSError):
@@ -1955,8 +1946,6 @@
             self.argvHistory,
             self.wdHistory,
             self.envHistory,
-            self.exceptions,
-            self.unhandledExceptions,
             self.ui,
             StartDialogMode.Coverage,
             autoClearShell=self.autoClearShell,
@@ -1972,8 +1961,6 @@
                 argv,
                 wd,
                 env,
-                exceptions,
-                unhandledExceptions,
                 clearShell,
                 console,
             ) = dlg.getData()
@@ -1994,7 +1981,6 @@
                     argv,
                     wd,
                     env,
-                    exceptions,
                     self.excList,
                     self.excIgnoreList,
                     clearShell,
@@ -2044,10 +2030,6 @@
             self.setWdHistory(wd)
             self.setEnvHistory(env)
 
-            # Save the exception flags
-            self.exceptions = exceptions
-            self.unhandledExceptions = unhandledExceptions
-
             # Save the erase coverage flag
             self.eraseCoverage = eraseCoverage
 
@@ -2159,8 +2141,6 @@
             self.argvHistory,
             self.wdHistory,
             self.envHistory,
-            self.exceptions,
-            self.unhandledExceptions,
             self.ui,
             StartDialogMode.Profile,
             autoClearShell=self.autoClearShell,
@@ -2176,8 +2156,6 @@
                 argv,
                 wd,
                 env,
-                exceptions,
-                unhandledExceptions,
                 clearShell,
                 console,
             ) = dlg.getData()
@@ -2198,7 +2176,6 @@
                     argv,
                     wd,
                     env,
-                    exceptions,
                     self.excList,
                     self.excIgnoreList,
                     clearShell,
@@ -2248,10 +2225,6 @@
             self.setWdHistory(wd)
             self.setEnvHistory(env)
 
-            # Save the exception flags
-            self.exceptions = exceptions
-            self.unhandledExceptions = unhandledExceptions
-
             # Save the erase timing flag
             self.eraseTimings = eraseTimings
 
@@ -2359,8 +2332,6 @@
             self.argvHistory,
             self.wdHistory,
             self.envHistory,
-            self.exceptions,
-            self.unhandledExceptions,
             self.ui,
             StartDialogMode.Run,
             autoClearShell=self.autoClearShell,
@@ -2376,8 +2347,6 @@
                 argv,
                 wd,
                 env,
-                exceptions,
-                unhandledExceptions,
                 clearShell,
                 console,
             ) = dlg.getData()
@@ -2397,7 +2366,6 @@
                     argv,
                     wd,
                     env,
-                    exceptions,
                     self.excList,
                     self.excIgnoreList,
                     clearShell,
@@ -2447,10 +2415,6 @@
             self.setWdHistory(wd)
             self.setEnvHistory(env)
 
-            # Save the exception flags
-            self.exceptions = exceptions
-            self.unhandledExceptions = unhandledExceptions
-
             # Save the clear interpreter flag
             self.autoClearShell = clearShell
 
@@ -2554,13 +2518,12 @@
             self.argvHistory,
             self.wdHistory,
             self.envHistory,
-            self.exceptions,
-            self.unhandledExceptions,
             self.ui,
             StartDialogMode.Debug,
             tracePython=self.tracePython,
             autoClearShell=self.autoClearShell,
             autoContinue=self.autoContinue,
+            reportAllExceptions=self.reportAllExceptions,
             enableMultiprocess=self.enableMultiprocess,
             multiprocessNoDebugHistory=self.multiprocessNoDebugHistory,
             configOverride=self.overrideGlobalConfig,
@@ -2575,8 +2538,6 @@
                 argv,
                 wd,
                 env,
-                exceptions,
-                unhandledExceptions,
                 clearShell,
                 console,
             ) = dlg.getData()
@@ -2584,6 +2545,7 @@
             (
                 tracePython,
                 autoContinue,
+                reportAllExceptions,
                 enableMultiprocess,
                 multiprocessNoDebug,
             ) = dlg.getDebugData()
@@ -2602,12 +2564,12 @@
                     argv,
                     wd,
                     env,
-                    exceptions,
                     self.excList,
                     self.excIgnoreList,
                     clearShell,
                     tracePython=tracePython,
                     autoContinue=autoContinue,
+                    reportAllExceptions=reportAllExceptions,
                     enableMultiprocess=enableMultiprocess,
                     multiprocessNoDebug=multiprocessNoDebug,
                     configOverride=configOverride,
@@ -2656,10 +2618,6 @@
             self.setWdHistory(wd)
             self.setEnvHistory(env)
 
-            # Save the exception flags
-            self.exceptions = exceptions
-            self.unhandledExceptions = unhandledExceptions
-
             # Save the tracePython flag
             self.tracePython = tracePython
 
@@ -2672,6 +2630,9 @@
             # Save the auto continue flag
             self.autoContinue = autoContinue
 
+            # Save the exception reporting flag
+            self.reportAllExceptions = reportAllExceptions
+
             # Save the multiprocess debugging data
             self.enableMultiprocess = enableMultiprocess
             self.setMultiprocessNoDebugHistory(multiprocessNoDebug)
@@ -2712,6 +2673,7 @@
                     enableMultiprocess=enableMultiprocess,
                     multiprocessNoDebug=multiprocessNoDebug,
                     configOverride=self.overrideGlobalConfig,
+                    reportAllExceptions=self.reportAllExceptions,
                 )
 
                 if (

eric ide

mercurial