From 336c093bf8faebd5bb36d6fe62e025b7e85c6e69 Mon Sep 17 00:00:00 2001 From: Dan Date: Fri, 8 Jan 2021 15:15:24 -0500 Subject: [PATCH] Catch errors when building enumeration lists. --- crc/services/workflow_service.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/crc/services/workflow_service.py b/crc/services/workflow_service.py index cb6903d5..82a4610d 100644 --- a/crc/services/workflow_service.py +++ b/crc/services/workflow_service.py @@ -586,6 +586,13 @@ class WorkflowService(object): items = data_model.items() if isinstance(data_model, dict) else data_model options = [] for item in items: + if value_column not in item: + raise ApiError.from_task("invalid_enum", f"The value column '{value_column}' does not exist for item {item}", + task=spiff_task) + if label_column not in item: + raise ApiError.from_task("invalid_enum", f"The label column '{label_column}' does not exist for item {item}", + task=spiff_task) + options.append({"id": item[value_column], "name": item[label_column], "data": item}) return options