Merge pull request #80 from chrysn-pull-requests/error-reporting-enhancements-noassert

Error reporting enhancements (conditional-raise-instead-of-assert version)
This commit is contained in:
Samantha Baldwin
2016-12-15 15:37:31 -05:00
committed by GitHub
2 changed files with 7 additions and 1 deletions

View File

@@ -201,6 +201,9 @@ class ImageVerifyTask(log.Loggable, task.MultiSeparateTask):
self.setException(taskk.exception)
break
if taskk.length is None:
raise ValueError("Track length was not found; look for "
"earlier errors in debug log (set RIP_DEBUG=4)")
# print '%d has length %d' % (trackIndex, taskk.length)
index = track.indexes[1]
assert taskk.length % common.SAMPLES_PER_FRAME == 0

View File

@@ -45,7 +45,10 @@ def main():
'rip: error: Could not create encoded file.\n')
return 255
raise
# in python3 we can instead do `raise e.exception` as that would show
# the exception's original context
sys.stderr.write(e.exceptionMessage)
return 255
except command.CommandError, e:
sys.stderr.write('rip: error: %s\n' % e.output)
return e.status