mirror of
https://github.com/tauri-apps/tauri.git
synced 2026-04-01 10:01:07 +02:00
This commit is contained in:
committed by
GitHub
parent
6839fde11d
commit
ed71679368
5
.changes/updater-detailed-unsupported-error.md
Normal file
5
.changes/updater-detailed-unsupported-error.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"tauri": patch
|
||||
---
|
||||
|
||||
**Breaking change**: Removed the `tauri::updater::Error::UnsupportedPlatform` variant and added `UnsupportedLinuxPackage`, `UnsupportedOs` and `UnsupportedArch` for better error information.
|
||||
@@ -312,8 +312,8 @@ impl<R: Runtime> UpdateBuilder<R> {
|
||||
let target = self
|
||||
.target
|
||||
.or_else(|| get_updater_target().map(Into::into))
|
||||
.ok_or(Error::UnsupportedPlatform)?;
|
||||
let arch = get_updater_arch().ok_or(Error::UnsupportedPlatform)?;
|
||||
.ok_or(Error::UnsupportedOs)?;
|
||||
let arch = get_updater_arch().ok_or(Error::UnsupportedArch)?;
|
||||
let json_target = if has_custom_target {
|
||||
target.clone()
|
||||
} else {
|
||||
@@ -498,7 +498,7 @@ impl<R: Runtime> Update<R> {
|
||||
// anythin with it yet
|
||||
#[cfg(target_os = "linux")]
|
||||
if self.app.state::<Env>().appimage.is_none() {
|
||||
return Err(Error::UnsupportedPlatform);
|
||||
return Err(Error::UnsupportedLinuxPackage);
|
||||
}
|
||||
|
||||
// set our headers
|
||||
|
||||
@@ -41,9 +41,17 @@ pub enum Error {
|
||||
/// Error building updater.
|
||||
#[error("Unable to extract the new version: {0}")]
|
||||
Extract(String),
|
||||
/// Updater is not supported for current operating system or platform.
|
||||
#[error("Unsupported operating system or platform")]
|
||||
UnsupportedPlatform,
|
||||
/// Updater cannot be executed on this Linux package. Currently the updater is enabled only on AppImages.
|
||||
#[error("Cannot run updater on this Linux package. Currently only an AppImage can be updated.")]
|
||||
UnsupportedLinuxPackage,
|
||||
/// Operating system is not supported.
|
||||
#[error("unsupported OS, expected one of `linux`, `darwin` or `windows`.")]
|
||||
UnsupportedOs,
|
||||
/// Unsupported app architecture.
|
||||
#[error(
|
||||
"Unsupported application architecture, expected one of `x86`, `x86_64`, `arm` or `aarch64`."
|
||||
)]
|
||||
UnsupportedArch,
|
||||
/// The platform was not found on the updater JSON response.
|
||||
#[error("the platform `{0}` was not found on the response `platforms` object")]
|
||||
TargetNotFound(String),
|
||||
|
||||
Reference in New Issue
Block a user