Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .changelog/43.fixed.md
Original file line number Diff line number Diff line change
@@ -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
7 changes: 4 additions & 3 deletions src/generator/core/base_feature.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions src/generator/templates/unreal.mako
Original file line number Diff line number Diff line change
Expand Up @@ -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}"] ) {</%text>
% endif
executePythonScript(scriptName, arguments)
% if feature_config.automation.logs_folder:
% if feature_config.automation and feature_config.automation.logs_folder:
}
% endif
}
Expand Down
Loading