checker_results.problems: don't str the whole Failure, just extract the reason string

This commit is contained in:
Brian Warner 2008-08-11 21:23:06 -07:00
parent d106e411af
commit 79576cf75b
1 changed files with 5 additions and 1 deletions

View File

@ -189,7 +189,11 @@ class MutableChecker:
report.append("Corrupt Shares:")
for (peerid, shnum, f) in sorted(self.bad_shares):
s = "%s-sh%d" % (idlib.shortnodeid_b2a(peerid), shnum)
report.append(" %s: %s" % (s, f))
if f.check(CorruptShareError):
ft = f.value.reason
else:
ft = str(f)
report.append(" %s: %s" % (s, ft))
p = (peerid, self._storage_index, shnum, f)
self.results.problems.append(p)