diff options
| -rw-r--r-- | mullvad-daemon/src/version/downloader.rs | 12 | ||||
| -rw-r--r-- | mullvad-daemon/src/version/mod.rs | 10 |
2 files changed, 13 insertions, 9 deletions
diff --git a/mullvad-daemon/src/version/downloader.rs b/mullvad-daemon/src/version/downloader.rs index e6ba216223..d1d9126f5b 100644 --- a/mullvad-daemon/src/version/downloader.rs +++ b/mullvad-daemon/src/version/downloader.rs @@ -7,7 +7,6 @@ use std::time::Duration; use std::{future::Future, path::PathBuf}; use tokio::fs; -use super::Error; type Result<T> = std::result::Result<T, Error>; pub struct Downloader(()); @@ -35,6 +34,17 @@ pub enum UpdateEvent { Verified { verified_installer_path: PathBuf }, } +pub enum Error { + #[error("Failed to get download directory")] + GetDownloadDir(#[from] mullvad_paths::Error), + + #[error("Failed to create download directory")] + CreateDownloadDir(#[source] io::Error), + + #[error("Could not select URL for app update")] + NoUrlFound, +} + impl Downloader { /// Begin or resume download of `version` pub async fn start( diff --git a/mullvad-daemon/src/version/mod.rs b/mullvad-daemon/src/version/mod.rs index 454acbdc04..7c769ceb99 100644 --- a/mullvad-daemon/src/version/mod.rs +++ b/mullvad-daemon/src/version/mod.rs @@ -39,14 +39,8 @@ pub enum Error { #[error("Version cache update was aborted")] UpdateAborted, - #[error("Failed to get download directory")] - GetDownloadDir(#[from] mullvad_paths::Error), - - #[error("Failed to create download directory")] - CreateDownloadDir(#[source] io::Error), - - #[error("Could not select URL for app update")] - NoUrlFound, + #[cfg(update)] + Update(#[transparent] downloader::Error), } /// Contains the date of the git commit this was built from |
