flip link_archive exception throw order so real exception is easier to read at the bottom

This commit is contained in:
Nick Sweeting 2024-09-25 00:39:49 -07:00
parent 6742888278
commit ee5bec6a10
No known key found for this signature in database

View file

@ -181,10 +181,10 @@ def archive_link(link: Link, overwrite: bool=False, methods: Optional[Iterable[s
#f.write(f"\n> {command}; ts={ts} version={config['VERSION']} docker={config['IN_DOCKER']} is_tty={config['IS_TTY']}\n") #f.write(f"\n> {command}; ts={ts} version={config['VERSION']} docker={config['IN_DOCKER']} is_tty={config['IS_TTY']}\n")
# print(f' ERROR: {method_name} {e.__class__.__name__}: {e} {getattr(e, "hints", "")}', ts, link.url, command) # print(f' ERROR: {method_name} {e.__class__.__name__}: {e} {getattr(e, "hints", "")}', ts, link.url, command)
raise Exception('Exception in archive_methods.save_{}(Link(url={}))'.format( raise e from Exception('Exception in archive_methods.save_{}(Link(url={}))'.format(
method_name, method_name,
link.url, link.url,
)) from e ))
# print(' ', stats) # print(' ', stats)