mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-02-01 18:41:54 +08:00
init
This commit is contained in:
32
libs/ventoy-img-rs/src/error.rs
Normal file
32
libs/ventoy-img-rs/src/error.rs
Normal file
@@ -0,0 +1,32 @@
|
||||
//! Error types for ventoy-img
|
||||
|
||||
use thiserror::Error;
|
||||
|
||||
#[derive(Error, Debug)]
|
||||
pub enum VentoyError {
|
||||
#[error("IO error: {0}")]
|
||||
Io(#[from] std::io::Error),
|
||||
|
||||
#[error("Invalid image size: {0}. Minimum is 64MB")]
|
||||
InvalidSize(String),
|
||||
|
||||
#[error("Failed to parse size string: {0}")]
|
||||
SizeParseError(String),
|
||||
|
||||
#[error("Partition error: {0}")]
|
||||
PartitionError(String),
|
||||
|
||||
#[error("Filesystem error: {0}")]
|
||||
FilesystemError(String),
|
||||
|
||||
#[error("Image not found or invalid: {0}")]
|
||||
ImageError(String),
|
||||
|
||||
#[error("File not found: {0}")]
|
||||
FileNotFound(String),
|
||||
|
||||
#[error("Resource not found: {0}")]
|
||||
ResourceNotFound(String),
|
||||
}
|
||||
|
||||
pub type Result<T> = std::result::Result<T, VentoyError>;
|
||||
Reference in New Issue
Block a user