From 323131cbc524ce8dfa41d9533e7468f3fa7b649e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Tue, 9 Apr 2019 16:56:17 +0200 Subject: [PATCH] =?UTF-8?q?=E2=98=94=20Harden=20against=20estimation=20exc?= =?UTF-8?q?eptions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/octoprint/printer/standard.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/octoprint/printer/standard.py b/src/octoprint/printer/standard.py index 5beac173e..420a0bf17 100644 --- a/src/octoprint/printer/standard.py +++ b/src/octoprint/printer/standard.py @@ -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,