26-integration-tests #35

Merged
Mr_Steppy merged 16 commits from 26-integration-tests into master 2026-08-26 18:35:30 +02:00
Showing only changes of commit 3f62bb3190 - Show all commits

View File

@ -202,16 +202,21 @@ impl<T> CommandResult<T, StartError> {
} }
} }
impl CommandResult<CommandOutput, ExecutionError<CommandOutput>> { impl<T> CommandResult<T, ExecutionError<T>> {
pub fn into_result_with_error_logging( pub fn into_result_with_error_logging(
self, self,
logger: &Logger, logger: &Logger,
) -> Result<CommandOutput, CommandError<ExecutionError<CommandOutput>>> { ) -> Result<T, CommandError<ExecutionError<T>>>
where
T: MaybeCast<CommandOutput>,
{
self.result.map_err(|error| { self.result.map_err(|error| {
if let ExecutionError::BadExitStatus(output) = &error { if let ExecutionError::BadExitStatus(t) = &error {
if let Some(output) = t.maybe_cast() {
log!(logger, error, "{}", output.stdout.to_string_lossy()); log!(logger, error, "{}", output.stdout.to_string_lossy());
log!(logger, error, "{}", output.stderr.to_string_lossy()); log!(logger, error, "{}", output.stderr.to_string_lossy());
} }
}
CommandError { CommandError {
command: self.command, command: self.command,
error, error,