add logging to fit exception to retain more info and find problem with #56; all references to current graph are either None or id, should close #57

This commit is contained in:
Dominik Demuth
2023-05-03 19:04:25 +02:00
parent adcd98fc31
commit 75ec462efd
5 changed files with 14 additions and 21 deletions

View File

@ -110,7 +110,7 @@ class UpperManagement(QtCore.QObject):
self.counter = 0
self.data = OrderedDict()
self.window = window
self.current_graph = ''
self.current_graph = None
self.graphs = GraphDict(self.data)
self.namespace = None
self.undostack = QtWidgets.QUndoStack()
@ -489,12 +489,14 @@ class UpperManagement(QtCore.QObject):
@QtCore.pyqtSlot(list, bool)
def end_fit(self, result: list, success: bool):
logger.info('FIT FINISHED')
if success:
logger.info('Successful fit')
self.fitFinished.emit(result)
else:
e = result[0]
logger.exception(e, exc_info=True)
QtWidgets.QMessageBox.warning(QtWidgets.QWidget(), 'Fit failed',
'Fit kaput with exception: \n' + "\n".join(result[0]))
f'Fit kaput with exception: \n\n{e!r}')
self.fitFinished.emit([])
self._fit_active = False
@ -1213,6 +1215,6 @@ class FitWorker(QtCore.QObject):
res = self.fitter.run(mode=self.mode)
success = True
except Exception as e:
res = [e.args]
res = [e]
success = False
self.finished.emit(res, success)