From 981769b051292981992c5d7ee37e5d0ebfae18df Mon Sep 17 00:00:00 2001 From: caryoscelus Date: Wed, 29 Jun 2022 17:53:41 +0000 Subject: [PATCH] improve error message this commit is adopted from d0069471b8bcf0a61b6c5a9849621f255580065a (https://github.com/zeronet-enhanced/ZeroNet/commit/d0069471b8bcf0a61b6c5a9849621f255580065a) 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. --- src/Content/ContentManager.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Content/ContentManager.py b/src/Content/ContentManager.py index 27da402b..20568701 100644 --- a/src/Content/ContentManager.py +++ b/src/Content/ContentManager.py @@ -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)))