From 530325c46137ed9426bca0e6d92fc99d372ebb2e Mon Sep 17 00:00:00 2001 From: Timothy Nunn Date: Tue, 5 May 2026 17:00:30 +0100 Subject: [PATCH] Raise error for unrecognised input before new data structure check --- process/core/input.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/process/core/input.py b/process/core/input.py index 825efef1d..4de1b391c 100644 --- a/process/core/input.py +++ b/process/core/input.py @@ -2137,6 +2137,12 @@ def parse_input_file(data_structure_obj: DataStructure): variable_config = copy.copy(INPUT_VARIABLES.get(variable_name)) + if variable_config is None: + error_msg = ( + f"Unrecognised input '{variable_name}' at line {line_no} of input file." + ) + raise ProcessValidationError(error_msg) + # string indicates it should be set on the new object data structure if isinstance(variable_config.module, str): module = data_structure_obj @@ -2145,12 +2151,6 @@ def parse_input_file(data_structure_obj: DataStructure): variable_config.module = module - if variable_config is None: - error_msg = ( - f"Unrecognised input '{variable_name}' at line {line_no} of input file." - ) - raise ProcessValidationError(error_msg) - # Validate the variable and also clean it (cast to correct type) # If the variable value (after the = sign) contains a ',' then it # defines the whole array so needs to be split down into its elements