Files
cgroups-rs/src/manager/error.rs
Xuewei Niu 0c26caecfc manager: Introduce SystemdManager
Systemd manager takes cgroups path in the format of
"parent:scope_prefix:name" to create and manipulate cgroups through
systemd. It does value conversions for resources defined in the Linux
resources from the OCI spec, such as CPU quota, period, etc.

Signed-off-by: Xuewei Niu <niuxuewei.nxw@antgroup.com>
2025-07-18 15:17:12 +08:00

29 lines
723 B
Rust

// Copyright (c) 2025 Ant Group
//
// SPDX-License-Identifier: Apache-2.0 or MIT
//
use crate::fs::error::Error as CgroupfsError;
use crate::systemd::dbus::error::Error as SystemdDbusError;
use crate::systemd::error::Error as SystemdCgroupError;
pub type Result<T> = std::result::Result<T, Error>;
#[derive(thiserror::Error, Debug)]
pub enum Error {
#[error("invalid argument")]
InvalidArgument,
#[error("invalid linux resource")]
InvalidLinuxResource,
#[error("cgroupfs error: {0}")]
Cgroupfs(#[from] CgroupfsError),
#[error("systemd cgroup error: {0}")]
SystemdCgroup(#[from] SystemdCgroupError),
#[error("systemd dbus error: {0}")]
SystemdDbus(#[from] SystemdDbusError),
}