From 69730293fac1de348646c9b8030e338f52afd1e2 Mon Sep 17 00:00:00 2001 From: Michael Delva Date: Thu, 2 Jul 2026 21:40:04 +0200 Subject: [PATCH 1/3] Swallow exceptions about non-existing def blocks when rendering a feature, but stop the process if it's something else --- src/generator/core/base_feature.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/generator/core/base_feature.py b/src/generator/core/base_feature.py index ab15ac1..dfded0d 100644 --- a/src/generator/core/base_feature.py +++ b/src/generator/core/base_feature.py @@ -76,9 +76,10 @@ def render_blocks(self, context: TemplateContext, template_lookup: TemplateLooku try: block = self.render_block(block_type, context, template) block_value.append(block) - except AttributeError: # as e: - # print(e) - # Block not defined in template - that's OK + except AttributeError as e: + # If the exception message matches the condition below, it means that the block is not defined in template - that's OK + if f"has no attribute 'render_{block_type}'" not in str(e): + raise e pass except Exception as e: logger.error("Error rendering %s for %s : %s", block_type, self.feature_name, e, exc_info=e) From 0fd0fba50f65f3151825d44dc88e5456c86ef55c Mon Sep 17 00:00:00 2001 From: Michael Delva Date: Thu, 2 Jul 2026 21:40:24 +0200 Subject: [PATCH 2/3] Fixed unreal feature which would not render additional functions if the automation config is not defined --- src/generator/templates/unreal.mako | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/generator/templates/unreal.mako b/src/generator/templates/unreal.mako index 4644c66..7554a23 100644 --- a/src/generator/templates/unreal.mako +++ b/src/generator/templates/unreal.mako @@ -85,12 +85,12 @@ ${feature_config._accumulator['buildgraph_properties']} } def executeAutomationScript(String scriptName, String arguments) { - % if feature_config.automation.logs_folder: + % if feature_config.automation and feature_config.automation.logs_folder: def logFolder = "${feature_config.automation.logs_folder}" <%text>withEnv( ["uebp_LogFolder=${logFolder}"] ) { % endif executePythonScript(scriptName, arguments) - % if feature_config.automation.logs_folder: + % if feature_config.automation and feature_config.automation.logs_folder: } % endif } From 73197b717794b48540aee46d8a8285bb081efba6 Mon Sep 17 00:00:00 2001 From: Michael Delva Date: Thu, 2 Jul 2026 21:42:33 +0200 Subject: [PATCH 3/3] towncrier entry --- .changelog/43.fixed.md | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .changelog/43.fixed.md diff --git a/.changelog/43.fixed.md b/.changelog/43.fixed.md new file mode 100644 index 0000000..13c163e --- /dev/null +++ b/.changelog/43.fixed.md @@ -0,0 +1,2 @@ +Don't swallow exceptions which are not related to absence of def blocks in feature template files +Fixed condition in the unreal feature which would not render additional functions if there was no automation config in the yaml \ No newline at end of file