Skip to content

Commit

Permalink
☔ Harden against estimation exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
foosel committed Apr 9, 2019
1 parent f389773 commit 323131c
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/octoprint/printer/standard.py
Expand Up @@ -859,11 +859,14 @@ def _updateProgressDataCallback(self):
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,
Expand Down

0 comments on commit 323131c

Please sign in to comment.