mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-04-29 04:04:45 +00:00
agent: enrich some error code path
So that it is easier to find out why some function fails. Signed-off-by: Peng Tao <bergwolf@hyper.sh>
This commit is contained in:
parent
4f53e010b4
commit
326f1cc773
@ -1457,7 +1457,12 @@ impl LinuxContainer {
|
||||
linux.cgroups_path.clone()
|
||||
};
|
||||
|
||||
let cgroup_manager = FsManager::new(cpath.as_str())?;
|
||||
let cgroup_manager = FsManager::new(cpath.as_str()).map_err(|e| {
|
||||
anyhow!(format!(
|
||||
"fail to create cgroup manager with path {}: {:}",
|
||||
cpath, e
|
||||
))
|
||||
})?;
|
||||
info!(logger, "new cgroup_manager {:?}", &cgroup_manager);
|
||||
|
||||
Ok(LinuxContainer {
|
||||
|
@ -840,7 +840,8 @@ pub fn get_mount_fs_type_from_file(mount_file: &str, mount_point: &str) -> Resul
|
||||
return Err(anyhow!("Invalid mount point {}", mount_point));
|
||||
}
|
||||
|
||||
let content = fs::read_to_string(mount_file)?;
|
||||
let content = fs::read_to_string(mount_file)
|
||||
.map_err(|e| anyhow!("read mount file {}: {}", mount_file, e))?;
|
||||
|
||||
let re = Regex::new(format!("device .+ mounted on {} with fstype (.+)", mount_point).as_str())?;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user