mirror of
https://github.com/Drop-OSS/drop.git
synced 2026-07-10 21:14:29 +10:00
f0112ec027
* fix: launching on linux * feat: #70 * feat: add dummy store page * feat: add store redir and refresh button to library * feat: cache first object fetching * feat: Remove let_chains feature and update to Rust 2024 Signed-off-by: quexeky <git@quexeky.dev> * feat: Check for if process was manually stopped Signed-off-by: quexeky <git@quexeky.dev> * fix: use bitcode instead of serde * chore: remove logs * fix: clippy * fix: clippy 2 * fix: swap to stop icon --------- Signed-off-by: quexeky <git@quexeky.dev> Co-authored-by: quexeky <git@quexeky.dev>
31 lines
1.1 KiB
Rust
31 lines
1.1 KiB
Rust
use std::{
|
|
fmt::{Display, Formatter},
|
|
io,
|
|
};
|
|
|
|
use serde_with::SerializeDisplay;
|
|
|
|
use super::remote_access_error::RemoteAccessError;
|
|
|
|
// TODO: Rename / separate from downloads
|
|
#[derive(Debug, SerializeDisplay)]
|
|
pub enum ApplicationDownloadError {
|
|
Communication(RemoteAccessError),
|
|
Checksum,
|
|
Lock,
|
|
IoError(io::ErrorKind),
|
|
DownloadError,
|
|
}
|
|
|
|
impl Display for ApplicationDownloadError {
|
|
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
|
|
match self {
|
|
ApplicationDownloadError::Communication(error) => write!(f, "{error}"),
|
|
ApplicationDownloadError::Lock => write!(f, "failed to acquire lock. Something has gone very wrong internally. Please restart the application"),
|
|
ApplicationDownloadError::Checksum => write!(f, "checksum failed to validate for download"),
|
|
ApplicationDownloadError::IoError(error) => write!(f, "io error: {error}"),
|
|
ApplicationDownloadError::DownloadError => write!(f, "download failed. See Download Manager status for specific error"),
|
|
}
|
|
}
|
|
}
|