pub enum DownloadError {
Io {
kind: String,
message: String,
},
Network {
message: String,
status_code: Option<u16>,
},
NotFound {
message: String,
},
InvalidQuantization {
value: String,
},
ResolutionFailed {
message: String,
},
QueueFull {
max_size: u32,
},
AlreadyQueued {
id: String,
},
NotInQueue {
id: String,
},
Cancelled,
Interrupted {
bytes_downloaded: u64,
},
IntegrityFailed {
expected: String,
actual: String,
},
Other {
message: String,
},
}Expand description
Error type for download operations.
Designed to be serializable across FFI boundaries (Tauri, CLI, etc.)
without depending on non-serializable types like std::io::Error.
Variants§
Io
I/O error during file operations.
Fields
Network
Network/HTTP error during download.
Fields
NotFound
Model or file not found on the remote server.
InvalidQuantization
Invalid quantization specified.
ResolutionFailed
Failed to resolve quantization to a file.
QueueFull
Queue is full, cannot add more downloads.
AlreadyQueued
Download is already queued.
NotInQueue
Download not found in queue.
Cancelled
Download was cancelled by user.
Interrupted
Download was interrupted and can be resumed.
IntegrityFailed
Integrity check failed (checksum mismatch).
Other
General/uncategorized error.
Implementations§
Source§impl DownloadError
impl DownloadError
Sourcepub fn io(kind: impl Into<String>, message: impl Into<String>) -> Self
pub fn io(kind: impl Into<String>, message: impl Into<String>) -> Self
Create an I/O error from kind and message strings.
Sourcepub fn from_io_error(err: &Error) -> Self
pub fn from_io_error(err: &Error) -> Self
Create an I/O error from a std::io::Error.
This captures the error kind name and message for serialization.
Sourcepub fn network_with_status(message: impl Into<String>, status_code: u16) -> Self
pub fn network_with_status(message: impl Into<String>, status_code: u16) -> Self
Create a network error with HTTP status code.
Sourcepub fn invalid_quantization(value: impl Into<String>) -> Self
pub fn invalid_quantization(value: impl Into<String>) -> Self
Create an invalid quantization error.
Sourcepub fn resolution_failed(message: impl Into<String>) -> Self
pub fn resolution_failed(message: impl Into<String>) -> Self
Create a resolution failed error.
Sourcepub const fn queue_full(max_size: u32) -> Self
pub const fn queue_full(max_size: u32) -> Self
Create a queue full error.
Sourcepub fn already_queued(id: impl Into<String>) -> Self
pub fn already_queued(id: impl Into<String>) -> Self
Create an already queued error.
Sourcepub fn not_in_queue(id: impl Into<String>) -> Self
pub fn not_in_queue(id: impl Into<String>) -> Self
Create a not in queue error.
Sourcepub fn integrity_failed(
expected: impl Into<String>,
actual: impl Into<String>,
) -> Self
pub fn integrity_failed( expected: impl Into<String>, actual: impl Into<String>, ) -> Self
Create an integrity check failed error.
Sourcepub const fn is_recoverable(&self) -> bool
pub const fn is_recoverable(&self) -> bool
Check if this error is recoverable (can retry).
Sourcepub const fn is_cancelled(&self) -> bool
pub const fn is_cancelled(&self) -> bool
Check if this is a cancellation.
Sourcepub fn user_message(&self) -> String
pub fn user_message(&self) -> String
Convert to a user-friendly message.
Trait Implementations§
Source§impl Clone for DownloadError
impl Clone for DownloadError
Source§fn clone(&self) -> DownloadError
fn clone(&self) -> DownloadError
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more