Skip to content
Myr

Add command exit code to output if it fails

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Julian Kaindl · committed by GitHub · parent 990ed45 · Browse files · 2 files+11 added−3 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+11 added−3 removed

  • other:+11 added−3 removed

2 files+11 added−3 removed

modified:src/hyperfine/benchmark.rs+9 added-3 removed
61 unmodified lines
6263 if failure_action == CmdFailureAction::RaiseError && !result.status.success() {64 return Err(io::Error::new(65 io::ErrorKind::Other,66 format!(66 "Command terminated with non-zero exit code. \67 Use the '-i'/'--ignore-failure' option if you want to ignore this. \68 Alternatively, use the '--show-output' option to debug what went wrong.",67 "{}. \68 Use the '-i'/'--ignore-failure' option if you want to ignore this. \69 Alternatively, use the '--show-output' option to debug what went wrong.",70 result.status.code().map_or(71 "The process has been terminated by a signal".into(),72 |c| format!("Command terminated with non-zero exit code: {}", c)73 )74 ),75 ));76 }7778 // Correct for shell spawning time
368 unmodified lines
modified:CHANGELOG.md+2 added
1# unreleased23- Add command exit code to output if it fails, see #342 (@KaindlJulian)45## Features67## Changes8
256 unmodified lines