Skip to content

Commit

Permalink
Better error handling for capture issues during timelapsing
Browse files Browse the repository at this point in the history
Should help debugging issue #425 and any future problems in that area.
  • Loading branch information
foosel committed Apr 1, 2014
1 parent 8cc8e45 commit 1a7a468
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/octoprint/timelapse.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,10 +236,13 @@ def captureImage(self):
return filename

def _captureWorker(self, filename):
eventManager().fire(Events.CAPTURE_START, {"file": filename});
urllib.urlretrieve(self._snapshotUrl, filename)
self._logger.debug("Image %s captured from %s" % (filename, self._snapshotUrl))
eventManager().fire(Events.CAPTURE_DONE, {"file": filename});
eventManager().fire(Events.CAPTURE_START, {"file": filename})
try:
urllib.urlretrieve(self._snapshotUrl, filename)
self._logger.debug("Image %s captured from %s" % (filename, self._snapshotUrl))
except:
self._logger.exception("Could not capture image %s from %s" % (filename, self._snapshotUrl))
eventManager().fire(Events.CAPTURE_DONE, {"file": filename})

def _createMovie(self, success=True):
ffmpeg = settings().get(["webcam", "ffmpeg"])
Expand Down

0 comments on commit 1a7a468

Please sign in to comment.