Ver código fonte

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

Nick Sweeting 1 ano atrás
pai
commit
ee5bec6a10
1 arquivos alterados com 2 adições e 2 exclusões
  1. 2 2
      archivebox/extractors/__init__.py

+ 2 - 2
archivebox/extractors/__init__.py

@@ -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")
 
                 # 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,
                     link.url,
-                )) from e
+                ))
 
 
         # print('    ', stats)