pub enum CommonError {
Io(Error),
Config(String),
NotFound(String),
AlreadyExists(String),
InvalidState(String),
Timeout(String),
PermissionDenied(String),
Internal(String),
}Expand description
Common errors that occur across multiple ArcBox crates.
This enum provides a unified set of error variants for common scenarios
like I/O errors, configuration issues, and resource lookup failures.
Crate-specific errors should wrap this type using #[from] attribute.
Variants§
Io(Error)
I/O error from the standard library.
This is the most common error type, wrapping std::io::Error for
filesystem operations, network I/O, and other system calls.
Config(String)
Configuration error.
Indicates invalid or missing configuration values, malformed config files, or configuration validation failures.
NotFound(String)
Resource not found.
Used when a requested resource (container, image, volume, network, etc.) does not exist in the system.
AlreadyExists(String)
Resource already exists.
Used when attempting to create a resource that already exists.
InvalidState(String)
Invalid state transition.
Indicates that an operation was attempted on a resource that is not in a valid state for that operation (e.g., stopping an already stopped container).
Timeout(String)
Operation timeout.
Used when an operation exceeds its allowed time limit.
PermissionDenied(String)
Permission denied.
Used when an operation fails due to insufficient permissions.
Internal(String)
Internal error.
A catch-all for unexpected internal errors. Should include enough context for debugging.
Implementations§
Source§impl CommonError
impl CommonError
Sourcepub fn already_exists(resource: impl Into<String>) -> Self
pub fn already_exists(resource: impl Into<String>) -> Self
Creates a new already exists error.
Sourcepub fn invalid_state(msg: impl Into<String>) -> Self
pub fn invalid_state(msg: impl Into<String>) -> Self
Creates a new invalid state error.
Sourcepub fn permission_denied(resource: impl Into<String>) -> Self
pub fn permission_denied(resource: impl Into<String>) -> Self
Creates a new permission denied error.
Sourcepub const fn is_not_found(&self) -> bool
pub const fn is_not_found(&self) -> bool
Returns true if this is a not found error.
Sourcepub const fn is_already_exists(&self) -> bool
pub const fn is_already_exists(&self) -> bool
Returns true if this is an already exists error.
Sourcepub const fn is_timeout(&self) -> bool
pub const fn is_timeout(&self) -> bool
Returns true if this is a timeout error.