Better Vagrant error handling

This commit is contained in:
Roey Darwish Dror
2020-06-25 08:37:29 +03:00
parent 124b3f2506
commit 4fff6ba56f
3 changed files with 12 additions and 4 deletions

View File

@@ -245,7 +245,8 @@ impl CommandExt for Command {
trace!("Output of {:?}: {:?}", self, output);
let status = output.status;
if !status.success() {
return Err(TopgradeError::ProcessFailed(status).into());
let stderr = String::from_utf8(output.stderr).unwrap_or_default();
return Err(TopgradeError::ProcessFailedWithOutput(status, stderr).into());
}
Ok(String::from_utf8(output.stdout)?)
}