apt-ostree/src/error.rs
robojerk 9f02fe2d69 Build apt-ostree Debian package with libostree 2025.2 compatibility
- Fix compilation errors in src/main.rs and resolve import conflicts
- Add debian/compat file and ensure debian/rules is executable
- Downgrade Cargo.lock to version 3 for compatibility with system cargo
- Create working apt-ostree binary with basic CLI functionality
- Build apt-ostree_0.1.0-1_amd64.deb package (1.1MB)
- Package installs successfully and binary works correctly
- Ensure libostree-1-1 (>= 2025.2) dependency for bootc compatibility
- Test package installation and basic commands (status, version)
2025-07-22 05:45:32 +00:00

103 lines
No EOL
2.3 KiB
Rust

/// Unified error type for apt-ostree operations
#[derive(Debug, thiserror::Error)]
pub enum AptOstreeError {
#[error("Initialization error: {0}")]
Initialization(String),
#[error("Configuration error: {0}")]
Configuration(String),
#[error("Permission denied: {0}")]
PermissionDenied(String),
#[error("Package error: {0}")]
Package(String),
#[error("OSTree error: {0}")]
Ostree(String),
#[error("APT error: {0}")]
Apt(String),
#[error("Filesystem error: {0}")]
Filesystem(String),
#[error("Network error: {0}")]
Network(String),
#[error("D-Bus error: {0}")]
Dbus(String),
#[error("Transaction error: {0}")]
Transaction(String),
#[error("Validation error: {0}")]
Validation(String),
#[error("Security error: {0}")]
Security(String),
#[error("System error: {0}")]
SystemError(String),
#[error("Package not found: {0}")]
PackageNotFound(String),
#[error("Branch not found: {0}")]
BranchNotFound(String),
#[error("Deployment error: {0}")]
Deployment(String),
#[error("Rollback error: {0}")]
Rollback(String),
#[error("DEB parsing error: {0}")]
DebParsing(String),
#[error("Package operation error: {0}")]
PackageOperation(String),
#[error("Script execution error: {0}")]
ScriptExecution(String),
#[error("Dependency conflict: {0}")]
DependencyConflict(String),
#[error("OSTree operation error: {0}")]
OstreeOperation(String),
#[error("Parse error: {0}")]
Parse(String),
#[error("Timeout error: {0}")]
Timeout(String),
#[error("Not found: {0}")]
NotFound(String),
#[error("Already exists: {0}")]
AlreadyExists(String),
#[error("Invalid argument: {0}")]
InvalidArgument(String),
#[error("Unsupported operation: {0}")]
Unsupported(String),
#[error("Internal error: {0}")]
Internal(String),
#[error("IO error: {0}")]
Io(#[from] std::io::Error),
#[error("JSON error: {0}")]
Json(#[from] serde_json::Error),
#[error("UTF-8 error: {0}")]
Utf8(#[from] std::string::FromUtf8Error),
}
/// Result type for apt-ostree operations
pub type AptOstreeResult<T> = Result<T, AptOstreeError>;