1#[derive(Debug, thiserror::Error)]
3#[non_exhaustive]
4pub enum Error {
5 #[error(transparent)]
7 GitHub(#[from] octocrab::Error),
8 #[error(transparent)]
10 Io(#[from] std::io::Error),
11 #[error(transparent)]
13 Semver(#[from] semver::Error),
14 #[error(transparent)]
16 Reqwest(#[from] reqwest::Error),
17 #[error(transparent)]
19 Minisign(#[from] minisign_verify::Error),
20 #[error(transparent)]
22 Http(#[from] http::Error),
23 #[error(transparent)]
25 InvalidHeaderValue(#[from] http::header::InvalidHeaderValue),
26 #[error(transparent)]
28 InvalidHeaderName(#[from] http::header::InvalidHeaderName),
29 #[error(
31 "Unsupported application architecture, expected one of `x86`, `x86_64`, `arm` or `aarch64`."
32 )]
33 UnsupportedArch,
34 #[error("Unsupported OS, expected one of `linux`, `darwin` or `windows`.")]
36 UnsupportedOs,
37 #[error("Asset not found.")]
39 AssetNotFound,
40 #[error("Failed to determine updater package extract path.")]
42 FailedToDetermineExtractPath,
43 #[error("The configured updater endpoint must use a secure protocol like `https`.")]
45 InsecureTransportProtocol,
46 #[error("the platform `{0}` was not found on the response `platforms` object")]
48 TargetNotFound(String),
49 #[error("missing signature asset for `{0}`")]
51 MissingSignatureAsset(String),
52 #[error("`{0}`")]
54 Network(String),
55 #[error("invalid updater binary format")]
57 InvalidUpdaterFormat,
58 #[error("failed to create temporary directory")]
60 TempDirNotFound,
61 #[error("Installation failed: insufficient privileges. Please run as administrator.")]
63 InsufficientPrivileges,
64 #[error("Installation failed: file in use. Please close the application and try again.")]
66 FileInUse,
67 #[error("Installation failed: installer execution error. Error code: {0}")]
69 InstallerExecutionFailed(i32),
70 #[error("Installation cancelled: User declined administrator privileges.")]
72 UserCancelledElevation,
73 #[error(transparent)]
75 Json(#[from] serde_json::Error),
76 #[error(transparent)]
78 Time(#[from] time::error::Parse),
79 #[cfg(target_os = "macos")]
80 #[error(transparent)]
82 Zip(#[from] zip::result::ZipError),
83}
84
85pub type Result<T> = std::result::Result<T, Error>;