Skip to main content

shape_command_result

Function shape_command_result 

Source
pub fn shape_command_result(
    action: &str,
    capture: CommandBodyCapture,
    outcome: ShellOutcome,
) -> Result<Value, ActivityFailure>
Expand description

Shape a successful command’s outcome into the action’s declared result.

The one place a runs command body’s capture is honoured, so the server and the aion worker awl executor cannot answer differently about what an action returns. Failure classification is NOT here: it belongs to the run and is the same for both captures, which is what stops two forms drifting into two failure vocabularies.

§Errors

Returns a terminal ActivityFailure when a json capture’s command printed output that is not valid JSON. Re-running it would print the same bytes, so nothing is gained by a retry.