Skip to content

Commit

Permalink
propagate exit code in error result when relevant
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenfiszel committed Nov 8, 2024
1 parent 8bc9a02 commit 8c6f5a3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions backend/windmill-worker/src/result_processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@ pub async fn process_result(
message: format!("error during execution of the script:\n{}", err),
name: "ExecutionErr".to_string(),
step_id: job.flow_step_id.clone(),
exit_code: None,
}),
};

Expand Down Expand Up @@ -608,6 +609,8 @@ pub struct SerializedError {
pub name: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub step_id: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub exit_code: Option<i32>,
}
pub fn extract_error_value(log_lines: &str, i: i32, step_id: Option<String>) -> Box<RawValue> {
return to_raw_value(&SerializedError {
Expand All @@ -617,5 +620,6 @@ pub fn extract_error_value(log_lines: &str, i: i32, step_id: Option<String>) ->
),
name: "ExecutionErr".to_string(),
step_id,
exit_code: Some(i),
});
}

0 comments on commit 8c6f5a3

Please sign in to comment.