From 6e9029815ace40dd36fcf0f50fe485aa8cc747bb Mon Sep 17 00:00:00 2001 From: 64Core Date: Wed, 8 Jun 2022 22:00:45 -0500 Subject: [PATCH] Exception stacks in download_library are printed to errors.txt, for issue #57 --- itchiodl/library.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/itchiodl/library.py b/itchiodl/library.py index fb7621a..2454dbd 100644 --- a/itchiodl/library.py +++ b/itchiodl/library.py @@ -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: