summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMarkus Pettersson <markus.pettersson@mullvad.net>2025-04-02 13:39:44 +0200
committerSebastian Holmin <sebastian.holmin@mullvad.net>2025-05-28 13:25:24 +0200
commitfa2ae2e2b841e45411d940abf8c0696f639ba92d (patch)
tree7e0c5dbbe548b0c851ba497c5ce4338571f1d726
parent3fa97cf751cf3f3703b89b8696b9d88e8615da41 (diff)
downloadmullvadvpn-fa2ae2e2b841e45411d940abf8c0696f639ba92d.tar.xz
mullvadvpn-fa2ae2e2b841e45411d940abf8c0696f639ba92d.zip
Fix hide in-app upgrade errors on some platforms
Linux and Android does not have the in-app upgrade feature, thus exposing the errors related to that feature does not make any sense.
-rw-r--r--mullvad-daemon/src/version/downloader.rs12
-rw-r--r--mullvad-daemon/src/version/mod.rs10
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