From ef47f9c7fb363a81e12e5a45de79a9eb4c60f303 Mon Sep 17 00:00:00 2001
From: Amir MOHAMMADI <amir.mohammadi@idiap.ch>
Date: Tue, 26 Apr 2022 14:17:15 +0200
Subject: [PATCH] [download] better error message

---
 bob/extension/download.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/bob/extension/download.py b/bob/extension/download.py
index a8e0808..f55aad4 100644
--- a/bob/extension/download.py
+++ b/bob/extension/download.py
@@ -279,8 +279,9 @@ def get_file(
         if file_hash is not None and not validate_file(
             final_filename, file_hash, algorithm=hash_algorithm
         ):
+            found_hash = _hash_file(final_filename, algorithm=hash_algorithm)
             raise ValueError(
-                "File was downloaded, but it is corrupted. Please re-do the procedure."
+                f"The downloaded file: {final_filename} has the hash of {found_hash}, but we expected {file_hash}. Please re-do the procedure."
             )
 
     return final_filename
-- 
GitLab