summaryrefslogtreecommitdiff
path: root/src/install.rs
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2021-03-25 09:37:15 +0000
committerLars Wirzenius <liw@liw.fi>2021-03-25 09:37:15 +0000
commita45450a42e4cdcd7f2d5671984c9c7f3945131fd (patch)
tree27e9b77e04a877a3efdb7b9795f5977060b3488a /src/install.rs
parent8e6febfb777714c5b7f5ed9843e660ef218d3eb0 (diff)
parent23138e5bdb8ca751834009d99d85b37e5e4ae5ae (diff)
downloadvmadm-a45450a42e4cdcd7f2d5671984c9c7f3945131fd.tar.gz
Merge branch 'errors' into 'main'
subplot fix and error message improvements Closes #14 See merge request larswirzenius/vmadm!29
Diffstat (limited to 'src/install.rs')
-rw-r--r--src/install.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/install.rs b/src/install.rs
index dce0fea..e74e6ba 100644
--- a/src/install.rs
+++ b/src/install.rs
@@ -17,9 +17,9 @@ pub enum VirtInstallError {
#[error("virt-install failed: {0}")]
VirtInstallFailed(String),
- /// I/O error.
- #[error(transparent)]
- IoError(#[from] std::io::Error),
+ /// Failed to run virt-install.
+ #[error("couldn't run virt-install")]
+ Run(#[source] std::io::Error),
/// Error parsing a string as UTF8.
#[error(transparent)]
@@ -115,7 +115,8 @@ pub fn virt_install(args: &VirtInstallArgs, iso: &Path) -> Result<PathBuf, VirtI
.arg("--graphics=spice")
.arg("--noautoconsole")
.arg("--quiet")
- .output()?;
+ .output()
+ .map_err(|err| VirtInstallError::Run(err))?;
if !r.status.success() {
let stderr = String::from_utf8(r.stderr)?;
return Err(VirtInstallError::VirtInstallFailed(stderr));