Fixes #1862, added way to see full stack trace on error situations

Signed-off-by: ameypd <h20220013@goa.bits-pilani.ac.in>
This commit is contained in:
ameypd 2022-11-25 19:41:49 +05:30
parent fcf6cf679f
commit fc0d53aae2

View file

@ -8,6 +8,7 @@
import logging
import os
import shutil
import traceback
from pathlib import Path
from tuf.api.exceptions import DownloadError, RepositoryError
@ -75,6 +76,8 @@ def download(target: str) -> bool:
except (OSError, RepositoryError, DownloadError) as e:
print(f"Failed to download target {target}: {e}")
if logging.root.level < logging.ERROR:
traceback.print_exc()
return False
return True