package cli import "fmt" // ExitError carries a dispatched subprocess exit code so the CLI can propagate the // exact status. The child already streamed its own stdout/stderr, so main exits // with this code without printing a duplicate diagnostic. type ExitError struct{ Code int } func (e *ExitError) Error() string { return fmt.Sprintf("subprocess exited with status %d", e.Code) } func (e *ExitError) ExitCode() int { return e.Code } // StatusError is a failure whose message is printed like any other error but // whose process exit status is Code rather than the generic 1, so a caller can // tell, for example, a run that ended unsuccessfully from a client failure. type StatusError struct { Code int Message string } func (e *StatusError) Error() string { return e.Message } // WaitRunsUnsuccessful is the `pipelines wait` / `run --wait` exit status when // every wait completed but at least one run ended failed, canceled or // interrupted. Client failures (unknown run, connection, wait limit) exit 1. const WaitRunsUnsuccessful = 2