From 0bceb772c2db7b9467d3a731f46bebbab1d704ed Mon Sep 17 00:00:00 2001 From: rlaphoenix Date: Sat, 4 Mar 2023 11:23:58 +0000 Subject: [PATCH] Handle exceptions in user's Service license funcs --- devine/commands/dl.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/devine/commands/dl.py b/devine/commands/dl.py index 99ac3a0..c3146b4 100644 --- a/devine/commands/dl.py +++ b/devine/commands/dl.py @@ -658,8 +658,12 @@ class dl: licence=licence, certificate=certificate ) - except (Widevine.Exceptions.EmptyLicense, Widevine.Exceptions.CEKNotFound) as e: - cek_tree.add(f"[logging.level.error]{e}") + except Exception as e: + if isinstance(e, (Widevine.Exceptions.EmptyLicense, Widevine.Exceptions.CEKNotFound)): + msg = str(e) + else: + msg = f"An exception occurred in the Service's license function: {e}" + cek_tree.add(f"[logging.level.error]{msg}") if not pre_existing_tree: table.add_row(cek_tree) raise e