Skip to content

Commit 67bd820

Browse files
committed
fix: guard against MSSDK package loading errors
If an error occurs in the package loading, due to validation or other failures, simply forward the error and continue loading the other packages.
1 parent b1c4ca2 commit 67bd820

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

src/ted_sws/mapping_suite_processor/services/mapping_package_processor.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -138,13 +138,17 @@ def load_mapping_suite_and_packages_from_github_to_mongo_db(mongodb_client: Mong
138138
for mapping_package_path in mapping_package_paths:
139139
detected_version = detect_mapping_package_version(mapping_package_path)
140140
log_technical_info(
141-
message=f"Mapping package version detected '{detected_version}'")
141+
message=f"Mapping package at '{mapping_package_path}' version detected '{detected_version}'")
142142
# convert if necessary while normalizing to v3(L), and validate (all under the hood)
143-
mssdk_package = load_mapping_package(
144-
include_test_data=load_test_data,
145-
validate_package=True,
146-
package_folder_path=mapping_package_path,
147-
)
143+
try:
144+
mssdk_package = load_mapping_package(
145+
include_test_data=load_test_data,
146+
validate_package=True,
147+
package_folder_path=mapping_package_path,
148+
)
149+
except Exception as e:
150+
log_mapping_package_error(f"Error loading mapping package from path '{mapping_package_path}': {str(e)}")
151+
continue
148152
converted_version = 'v3' if load_test_data else 'v3L' # MSSDK loads test data only for v3, not for v3L
149153
log_technical_info(
150154
message=f"Mapping package '{mssdk_package.id}' (format '{detected_version}' -> '{converted_version}') loaded from folder with success")

0 commit comments

Comments
 (0)