hypha: convert to using anyhow for error handling

This commit is contained in:
Alex Zenla
2024-01-30 02:15:03 -08:00
parent a1081ea79c
commit eec213c712
13 changed files with 42 additions and 190 deletions

View File

@ -1,6 +1,5 @@
use crate::error::Result;
use crate::hypha_err;
use crate::shared::LaunchInfo;
use anyhow::{anyhow, Result};
use log::trace;
use nix::libc::dup2;
use nix::unistd::execve;
@ -69,7 +68,9 @@ impl ContainerInit {
if let Some(cfg) = config.config() {
self.run(cfg, &launch)?;
} else {
return hypha_err!("unable to determine what to execute, image config doesn't tell us");
return Err(anyhow!(
"unable to determine what to execute, image config doesn't tell us"
));
}
Ok(())
}