Avoid exception in the except

This commit is contained in:
Valentin Valls 2019-04-08 14:05:52 +02:00
parent 948955a504
commit e6e8003026
1 changed files with 3 additions and 3 deletions

View File

@ -27,7 +27,7 @@ from __future__ import absolute_import
__authors__ = ["V. Valls"] __authors__ = ["V. Valls"]
__license__ = "MIT" __license__ = "MIT"
__date__ = "05/04/2019" __date__ = "08/04/2019"
import logging import logging
import numpy import numpy
@ -1112,7 +1112,7 @@ class PeakPickingTask(AbstractCalibrationTask):
self.__undoStack.push(command) self.__undoStack.push(command)
command.setRedoInhibited(False) command.setRedoInhibited(False)
except Exception as e: except Exception as e:
_logger.error(e.args[0]) _logger.error(str(e))
_logger.error("Backtrace", exc_info=True) _logger.error("Backtrace", exc_info=True)
# FIXME Display error dialog # FIXME Display error dialog
except KeyboardInterrupt: except KeyboardInterrupt:
@ -1132,7 +1132,7 @@ class PeakPickingTask(AbstractCalibrationTask):
controlPoints = model_transform.createControlPoints(self.model()) controlPoints = model_transform.createControlPoints(self.model())
controlPoints.save(filename) controlPoints.save(filename)
except Exception as e: except Exception as e:
_logger.error(e.args[0]) _logger.error(str(e))
_logger.error("Backtrace", exc_info=True) _logger.error("Backtrace", exc_info=True)
# FIXME Display error dialog # FIXME Display error dialog
except KeyboardInterrupt: except KeyboardInterrupt: