Exception stacks in download_library are printed to errors.txt, for issue #57

This commit is contained in:
64Core 2022-06-08 22:00:45 -05:00
parent 0dded2ab02
commit 6e9029815a

View file

@ -3,6 +3,7 @@ from concurrent.futures import ThreadPoolExecutor
import functools
import threading
import requests
import traceback
from bs4 import BeautifulSoup
from itchiodl.game import Game
@ -89,9 +90,11 @@ class Library:
with lock:
with open("errors.txt", "a") as f:
f.write(
f""" Cannot download game/asset: {g.name}
This game/asset has been skipped please download manually
---------------------------------------------------------\n """
f""" An error occurred while downloading: {g.name}\n """
)
traceback.print_exc(file=f)
f.write(
f""" -----------------------------------------------\n """
)
finally:
with lock: