From 4cde51df49a48e568c88a32ba92edf2002c51ee4 Mon Sep 17 00:00:00 2001 From: Gabriel Wicki Date: Wed, 22 Dec 2021 16:23:00 +0100 Subject: [PATCH] add both hashes to "Checksum mismatch"-Exception message --- lib/sysgeneral.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/sysgeneral.py b/lib/sysgeneral.py index edc094b..f9fc95a 100644 --- a/lib/sysgeneral.py +++ b/lib/sysgeneral.py @@ -59,7 +59,10 @@ class SysGeneral: readable_hash = hashlib.sha256(downloaded_content).hexdigest() if expected_hash == readable_hash: return - raise Exception("Checksum mismatch") + raise Exception(f"Checksum mismatch for file {os.path.basename(file_name)}:\n\ +expected: {expected_hash}\n\ +actual: {readable_hash}\n\ +When in doubt, try deleting the file in question -- it will be downloaded again when running this script the next time") raise Exception("File checksum is not yet recorded")