From: Ansgar Burchardt Date: Tue, 3 Feb 2015 19:52:41 +0000 (+0100) Subject: Rename exception. X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=f09f34fc963fd7eeb3c4f1992aad66ac0b1777b1;p=dak.git Rename exception. Also inherit from Reject so a proper rejection message is shown instead of a backtrace. --- diff --git a/daklib/checks.py b/daklib/checks.py index 26439aaa..70e1f5e3 100644 --- a/daklib/checks.py +++ b/daklib/checks.py @@ -57,7 +57,7 @@ class Reject(Exception): """exception raised by failing checks""" pass -class RejectStupidMaintainerException(Exception): +class RejectExternalFilesMismatch(Reject): """exception raised by failing the external hashes check""" def __str__(self): @@ -256,16 +256,16 @@ class ExternalHashesCheck(Check): return if ext_size != f.size: - raise RejectStupidMaintainerException(f.filename, 'size', f.size, ext_size) + raise RejectExternalFilesMismatch(f.filename, 'size', f.size, ext_size) if ext_md5sum != f.md5sum: - raise RejectStupidMaintainerException(f.filename, 'md5sum', f.md5sum, ext_md5sum) + raise RejectExternalFilesMismatch(f.filename, 'md5sum', f.md5sum, ext_md5sum) if ext_sha1sum != f.sha1sum: - raise RejectStupidMaintainerException(f.filename, 'sha1sum', f.sha1sum, ext_sha1sum) + raise RejectExternalFilesMismatch(f.filename, 'sha1sum', f.sha1sum, ext_sha1sum) if ext_sha256sum != f.sha256sum: - raise RejectStupidMaintainerException(f.filename, 'sha256sum', f.sha256sum, ext_sha256sum) + raise RejectExternalFilesMismatch(f.filename, 'sha256sum', f.sha256sum, ext_sha256sum) def check(self, upload): cnf = Config()