Przeglądaj źródła

Fix errors in migration that cause abnormal exit.

Stefano Cossu 5 lat temu
rodzic
commit
6a432670ad
1 zmienionych plików z 2 dodań i 2 usunięć
  1. 2 2
      lakesuperior/migrator.py

+ 2 - 2
lakesuperior/migrator.py

@@ -232,11 +232,11 @@ class Migrator:
         # Get the whole RDF document now because we have to know all outbound
         # Get the whole RDF document now because we have to know all outbound
         # links.
         # links.
         get_uri = (
         get_uri = (
-                uri if ldp_type == 'ldp_rs' else '{}/fcr:metadata'.format(uri))
+                uri if ldp_type == 'ldp_rs' else f'{uri}/fcr:metadata')
         try:
         try:
             get_rsp = requests.get(get_uri, auth=self.auth)
             get_rsp = requests.get(get_uri, auth=self.auth)
             get_rsp.raise_for_status()
             get_rsp.raise_for_status()
-        except:
+        except Exception as e:
             if self.skip_errors:
             if self.skip_errors:
                 logger.error(f'Error retrieving resource body: {e}')
                 logger.error(f'Error retrieving resource body: {e}')
                 return
                 return