Working error test, but cannot properly test exception handler
This commit is contained in:
+3
-1
@@ -54,9 +54,11 @@ class Config:
|
||||
# Set Application Variables
|
||||
self.appName = "novelWriter"
|
||||
self.appHandle = self.appName.lower()
|
||||
self.cmdOpen = None
|
||||
|
||||
# Debug Settings
|
||||
self.showGUI = True
|
||||
self.debugInfo = False
|
||||
self.cmdOpen = None
|
||||
|
||||
# Config Error Handling
|
||||
self.hasError = False
|
||||
|
||||
+3
-2
@@ -138,6 +138,7 @@ class NWErrorMessage(QDialog):
|
||||
def exceptionHandler(exType, exValue, exTrace):
|
||||
"""Function to catch unhandled global exceptions.
|
||||
"""
|
||||
import nw
|
||||
import logging
|
||||
from traceback import print_tb
|
||||
from PyQt5.QtWidgets import qApp
|
||||
@@ -158,9 +159,9 @@ def exceptionHandler(exType, exValue, exTrace):
|
||||
return
|
||||
|
||||
errMsg = NWErrorMessage(nwGUI)
|
||||
nwGUI.activeDialog = errMsg
|
||||
errMsg.setMessage(exType, exValue, exTrace)
|
||||
errMsg.exec_()
|
||||
if nw.CONFIG.showGUI:
|
||||
errMsg.exec_()
|
||||
|
||||
try:
|
||||
# Try a controlled shudown
|
||||
|
||||
Reference in New Issue
Block a user