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:
@ -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)
|
||||
|
Reference in New Issue
Block a user