☔ Harden against estimation exceptions

This commit is contained in:
Gina Häußge committed 2019-04-09 16:56:17 +02:00
1 parent f389773036
commit 323131cbc5
1 file changed
+8 -5
+8 -5
View File
@@ -859,11 +859,14 @@ class Printer(PrinterInterface, comm.MachineComPrintCallback):
statisticalTotalPrintTime = self._selectedFile["estimatedPrintTime"]
statisticalTotalPrintTimeType = self._selectedFile.get("estimatedPrintTimeType", None)
printTimeLeft, printTimeLeftOrigin = estimator.estimate(progress,
printTime,
cleanedPrintTime,
statisticalTotalPrintTime,
statisticalTotalPrintTimeType)
try:
printTimeLeft, printTimeLeftOrigin = estimator.estimate(progress,
printTime,
cleanedPrintTime,
statisticalTotalPrintTime,
statisticalTotalPrintTimeType)
except Exception:
self._logger.exception("Error while estimating print time via {}".format(estimator))
return self._dict(completion=progress * 100 if progress is not None else None,
filepos=filepos,