From 958598334ac8f399ce9fcb8cb865d20e3af79432 Mon Sep 17 00:00:00 2001 From: Escartem Date: Fri, 20 Oct 2023 14:52:28 +0200 Subject: [PATCH] better error handling --- extract.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/extract.py b/extract.py index 24f1321..2a1b32a 100644 --- a/extract.py +++ b/extract.py @@ -1,4 +1,5 @@ import os +import sys import shutil import zipfile import filecmp @@ -7,7 +8,7 @@ import subprocess from halo import Halo from progress.bar import PixelBar -# don't question how optimised this is + cwd = os.getcwd() path = lambda path: os.path.join(cwd, path) call = lambda args: subprocess.call(args, stdout=subprocess.DEVNULL, stderr=subprocess.STDOUT) @@ -259,7 +260,7 @@ def main(): print(f"[{curr}/{steps}] Cleaning up") except Exception as e: print("An error occured while processing this file ! Skipping to the next one, details of the error bellow :") - print(e) + print(f"Line {sys.exc_info()[-1].tb_lineno}, {e}") # all files processed if os.path.exists("temp"):