From 0735c716d1ec6dc138a1a103379ee81ed467b9c5 Mon Sep 17 00:00:00 2001 From: Thomas Vander Stichele Date: Fri, 18 Jan 2013 19:23:52 +0100 Subject: [PATCH] raise an exception for this error --- morituri/common/checksum.py | 5 ++++- morituri/common/common.py | 6 ++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/morituri/common/checksum.py b/morituri/common/checksum.py index b027be5..9a943e1 100644 --- a/morituri/common/checksum.py +++ b/morituri/common/checksum.py @@ -163,8 +163,11 @@ class ChecksumTask(log.Loggable, gstreamer.GstPipelineTask): self.debug("checksum: %08X", self._checksum) self.debug("bytes: %d", self._bytes) if self._frameEnd != last: - print 'ERROR: did not get all frames, %d of %d missing' % ( + msg = 'did not get all frames, %d of %d missing' % ( self._frameEnd - last, self._frameEnd) + self.warning(msg) + self.setException(common.MissingFrames(msg)) + return self.checksum = self._checksum diff --git a/morituri/common/common.py b/morituri/common/common.py index 7245179..6b6ff65 100644 --- a/morituri/common/common.py +++ b/morituri/common/common.py @@ -170,6 +170,12 @@ class MissingDependencyException(Exception): class EmptyError(Exception): pass +class MissingFrames(Exception): + """ + Less frames decoded than expected. + """ + pass + def shrinkPath(path): """