mirror of
https://github.com/Emersont1/itchio.git
synced 2026-03-11 08:54:39 +00:00
Testing some rudimentary error handling in download_library to look at issue #57
This commit is contained in:
parent
c0075c9d01
commit
0dded2ab02
1 changed files with 15 additions and 5 deletions
|
|
@ -83,10 +83,20 @@ class Library:
|
|||
lock = threading.RLock()
|
||||
|
||||
def dl(i, g):
|
||||
x = g.download(self.login, platform)
|
||||
with lock:
|
||||
i[0] += 1
|
||||
print(f"Downloaded {g.name} ({i[0]} of {l})")
|
||||
return x
|
||||
try:
|
||||
x = g.download(self.login, platform)
|
||||
except:
|
||||
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 """
|
||||
)
|
||||
finally:
|
||||
with lock:
|
||||
i[0] += 1
|
||||
print(f"Downloaded {g.name} ({i[0]} of {l})")
|
||||
return x
|
||||
|
||||
executor.map(functools.partial(dl, i), self.games)
|
||||
|
|
|
|||
Loading…
Reference in a new issue