mirror of
https://github.com/Escartem/AnimeWwise.git
synced 2026-06-22 04:02:58 +08:00
better error handling
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
import os
|
import os
|
||||||
|
import sys
|
||||||
import shutil
|
import shutil
|
||||||
import zipfile
|
import zipfile
|
||||||
import filecmp
|
import filecmp
|
||||||
@@ -7,7 +8,7 @@ import subprocess
|
|||||||
from halo import Halo
|
from halo import Halo
|
||||||
from progress.bar import PixelBar
|
from progress.bar import PixelBar
|
||||||
|
|
||||||
# don't question how optimised this is
|
|
||||||
cwd = os.getcwd()
|
cwd = os.getcwd()
|
||||||
path = lambda path: os.path.join(cwd, path)
|
path = lambda path: os.path.join(cwd, path)
|
||||||
call = lambda args: subprocess.call(args, stdout=subprocess.DEVNULL, stderr=subprocess.STDOUT)
|
call = lambda args: subprocess.call(args, stdout=subprocess.DEVNULL, stderr=subprocess.STDOUT)
|
||||||
@@ -259,7 +260,7 @@ def main():
|
|||||||
print(f"[{curr}/{steps}] Cleaning up")
|
print(f"[{curr}/{steps}] Cleaning up")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print("An error occured while processing this file ! Skipping to the next one, details of the error bellow :")
|
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
|
# all files processed
|
||||||
if os.path.exists("temp"):
|
if os.path.exists("temp"):
|
||||||
|
|||||||
Reference in New Issue
Block a user