fix: fix error handling of pre-processor steps

This commit is contained in:
Ruben Fiszel
2025-08-29 09:38:25 +00:00
parent fa43b7a672
commit 127ad349fc
2 changed files with 3 additions and 5 deletions
+1 -1
View File
@@ -520,7 +520,7 @@ function get_from_env(name) {{
.map(|a| { format!("let {a} = get_from_env(\"{a}\");\n",) })
.join(""),
if expr.contains("error") && transform_context.contains(&"previous_result".to_string()) {
"let error = previous_result.error"
"let error = previous_result.error;"
} else {
""
},
+2 -4
View File
@@ -1027,7 +1027,7 @@ pub async fn update_flow_status_after_job_completion_internal(
.ok_or_else(|| Error::internal_err(format!("requiring flow to be in the queue")))?;
tx.commit().await?;
if matches!(module_step, Step::PreprocessorStep) {
if matches!(module_step, Step::PreprocessorStep) && success {
let tag_and_concurrency_key = get_tag_and_concurrency(&flow, db).await;
let require_args = tag_and_concurrency_key.as_ref().is_some_and(|x| {
x.tag.as_ref().is_some_and(|t| t.contains("$args"))
@@ -1144,9 +1144,7 @@ pub async fn update_flow_status_after_job_completion_internal(
"error while updating args in preprocessing step: {e:#}"
))
})?;
if success {
return Ok(UpdateFlowStatusAfterJobCompletion::PreprocessingStep);
}
return Ok(UpdateFlowStatusAfterJobCompletion::PreprocessingStep);
}
let job_root = flow_job