1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
use thiserror::Error;
#[derive(Debug, Error)]
#[non_exhaustive]
pub enum Error {
#[error("`{0}`")]
Io(#[from] std::io::Error),
#[error("Unable to compare version: {0}")]
Semver(#[from] semver::Error),
#[error("JSON error: {0}")]
SerdeJson(#[from] serde_json::Error),
#[error("Verify signature error: {0}")]
Minisign(#[from] minisign_verify::Error),
#[error("Signature decoding error: {0}")]
Base64(#[from] base64::DecodeError),
#[error("The signature {0} could not be decoded, please check if it is a valid base64 string. The signature must be the contents of the `.sig` file generated by the Tauri bundler, as a string.")]
SignatureUtf8(String),
#[error("Tauri API error: {0}")]
TauriApi(#[from] crate::api::Error),
#[error("Network error: {0}")]
Network(String),
#[error("Could not fetch a valid release JSON from the remote")]
ReleaseNotFound,
#[error("Unable to prepare the updater: {0}")]
Builder(String),
#[error("Unable to extract the new version: {0}")]
Extract(String),
#[error("Cannot run updater on this Linux package. Currently only an AppImage can be updated.")]
UnsupportedLinuxPackage,
#[error("unsupported OS, expected one of `linux`, `darwin` or `windows`.")]
UnsupportedOs,
#[error(
"Unsupported application architecture, expected one of `x86`, `x86_64`, `arm` or `aarch64`."
)]
UnsupportedArch,
#[error("the platform `{0}` was not found on the response `platforms` object")]
TargetNotFound(String),
#[error("No updates available")]
UpToDate,
#[error("the updater response field `{0}` type is invalid, expected {1} but found {2}")]
InvalidResponseType(&'static str, &'static str, serde_json::Value),
#[error(transparent)]
Http(#[from] http::Error),
#[cfg(target_os = "linux")]
#[error("temp directory is not on the same mount point as the AppImage")]
TempDirNotOnSameMountPoint,
}
pub type Result<T = ()> = std::result::Result<T, Error>;