Skip to main content

exit_code_for_status

Function exit_code_for_status 

Source
pub fn exit_code_for_status(status: SessionStatus) -> ExitCode
Expand description

Map a terminal SessionStatus onto the CLI process exit code.

Why: run-task via the thin client and the legacy in-process run-task must agree on what a script checking $? sees. What: Finished -> ExitCode::Success; Cancelled/Failed -> ExitCode::RunFailure; DeadlineExceeded (#2207) -> its own distinct ExitCode::DeadlineExceeded, so a script can tell “timed out” from “errored” the same way the legacy path’s RunReport::exit does; Created/Running (should never be passed here — the caller only calls this once a run has reached a terminal status) also map to RunFailure defensively rather than panicking. Test: tests::exit_code_for_status_maps_terminal_states.