improve error message

this commit is adopted from d0069471b8
(d0069471b8)
by @geekless

with original commit message:

Don't raise VerifyError with misleading message
"Invalid old-style sign" when the file has no sign at all.
This commit is contained in:
caryoscelus 2022-06-29 17:53:41 +00:00
parent 8d0db14fbb
commit 981769b051

View file

@ -998,8 +998,10 @@ class ContentManager(object):
raise VerifyError("Valid signs: %s/%s" % (valid_signs, signs_required))
else:
return self.verifyContent(inner_path, new_content)
else: # Old style signing
elif sign:
raise VerifyError("Invalid old-style sign")
else:
raise VerifyError("Not signed")
except Exception as err:
self.log.warning("%s: verify sign error: %s" % (inner_path, Debug.formatException(err)))