From 3461ce3735d460d30a1c4d19c5191aeb6774e90d Mon Sep 17 00:00:00 2001 From: KnugiHK <24708955+KnugiHK@users.noreply.github.com> Date: Tue, 2 Jul 2024 20:34:18 +0800 Subject: [PATCH] Handle the FileNotFoundError in decryption (#98) --- Whatsapp_Chat_Exporter/ios_media_handler.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Whatsapp_Chat_Exporter/ios_media_handler.py b/Whatsapp_Chat_Exporter/ios_media_handler.py index 0342325..253a204 100644 --- a/Whatsapp_Chat_Exporter/ios_media_handler.py +++ b/Whatsapp_Chat_Exporter/ios_media_handler.py @@ -37,7 +37,10 @@ def extract_encrypted(base_dir, password, identifiers, decrypt_chunk_size): ) except ValueError: print("Failed to decrypt backup: incorrect password?") - exit() + exit(7) + except FileNotFoundError: + print("Essential WhatsApp files are missing from the iOS backup.") + exit(6) else: print("Done")