Add test for the main error handler

This commit is contained in:
Veronica K. B. Olsen
2020-09-19 13:06:58 +02:00
parent e9fd293689
commit 365e2676fb
7 changed files with 70 additions and 5 deletions
+2 -3
View File
@@ -35,6 +35,7 @@ class NWErrorMessage(QDialog):
def __init__(self, parent):
QDialog.__init__(self, parent=parent)
self.setObjectName("NWErrorMessage")
# Widgets
self.msgIcon = QLabel()
@@ -146,9 +147,6 @@ def exceptionHandler(exType, exValue, exTrace):
logger.critical("%s: %s" % (exType.__name__, str(exValue)))
print_tb(exTrace)
if not CONFIG.showGUI:
return
try:
nwGUI = None
for qWin in qApp.topLevelWidgets():
@@ -161,6 +159,7 @@ def exceptionHandler(exType, exValue, exTrace):
return
errMsg = NWErrorMessage(nwGUI)
nwGUI.activeDialog = errMsg
errMsg.setMessage(exType, exValue, exTrace)
errMsg.exec_()