From 776adaf617fa96f989c8779de65784ffc040ca91 Mon Sep 17 00:00:00 2001 From: csae8092 Date: Mon, 18 Dec 2023 12:47:20 +0100 Subject: [PATCH] try execpt for collection_to_mets --- transkribus_utils/transkribus_utils.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/transkribus_utils/transkribus_utils.py b/transkribus_utils/transkribus_utils.py index a4bd87a..68c7247 100644 --- a/transkribus_utils/transkribus_utils.py +++ b/transkribus_utils/transkribus_utils.py @@ -282,7 +282,12 @@ def collection_to_mets(self, col_id, file_path=".", filter_by_doc_ids=[]): print(f"{len(doc_ids)} to download") counter = 1 for doc_id in doc_ids: - save_mets = self.save_mets_to_file(doc_id, col_id, file_path=col_dir) + try: + save_mets = self.save_mets_to_file(doc_id, col_id, file_path=col_dir) + except Exception as e: + print(f"failed to save mets for DOC-ID: {doc_id} in COLLECTION: {col_id} due to ERROR: {e}") + counter += 1 + continue file_list = self.save_image_names_to_file(doc_id, col_id, file_path=col_dir) print(f"saving: {save_mets}") print(f"saving: {file_list}")