1#[derive(Debug, thiserror::Error)]
14pub enum Error {
15 #[error(transparent)]
17 GitHub(#[from] octocrab::Error),
18 #[error(transparent)]
20 Io(#[from] std::io::Error),
21 #[error(transparent)]
23 Semver(#[from] semver::Error),
24 #[error(
26 "Unsupported application architecture, expected one of `x86`, `x86_64`, `arm` or `aarch64`."
27 )]
28 UnsupportedArch,
29 #[error("Unsupported OS, expected one of `linux`, `darwin` or `windows`.")]
31 UnsupportedOs,
32 #[error("Asset not found.")]
34 AssetNotFound,
35 #[error("Failed to determine updater package extract path.")]
37 FailedToDetermineExtractPath,
38 #[error(transparent)]
40 Reqwest(#[from] reqwest::Error),
41 #[error("the platform `{0}` was not found on the response `platforms` object")]
43 TargetNotFound(String),
44 #[error("`{0}`")]
46 Network(String),
47 #[error("temp directory is not on the same mount point as the AppImage")]
49 TempDirNotOnSameMountPoint,
50 #[error("failed to create temporary directory")]
51 TempDirNotFound,
52 #[error("Authentication failed or was cancelled")]
53 AuthenticationFailed,
54 #[error("invalid updater binary format")]
55 InvalidUpdaterFormat,
56 #[error("Installation failed: insufficient privileges. Please run as administrator.")]
58 InsufficientPrivileges,
59 #[error("Installation failed: file in use. Please close the application and try again.")]
61 FileInUse,
62 #[error("Installation failed: installer execution error. Error code: {0}")]
64 InstallerExecutionFailed(i32),
65 #[error("Installation cancelled: User declined administrator privileges.")]
67 UserCancelledElevation,
68 #[error(transparent)]
69 Http(#[from] http::Error),
70 #[error(transparent)]
71 InvalidHeaderValue(#[from] http::header::InvalidHeaderValue),
72 #[error(transparent)]
73 InvalidHeaderName(#[from] http::header::InvalidHeaderName),
74 #[error(transparent)]
76 URLParseError(#[from] url::ParseError),
77 #[cfg(target_os = "macos")]
79 #[error(transparent)]
80 Zip(#[from] zip::result::ZipError),
81}
82
83pub type Result<T> = std::result::Result<T, Error>;