Download packages/tauri-plugins/plugins/updater/src/error.rs from echodict/readest: direct link, hf CLI and curl.
- Browser
- Download file 4.09 kB
-
https://huggingface.co/datasets/echodict/readest/resolve/main/packages/tauri-plugins/plugins/updater/src/error.rs
- Command line
-
hf download hf://datasets/echodict/readest/packages/tauri-plugins/plugins/updater/src/error.rs
-
curl -L -o error.rs https://huggingface.co/datasets/echodict/readest/resolve/main/packages/tauri-plugins/plugins/updater/src/error.rs
4.09 kB
| // Copyright 2019-2023 Tauri Programme within The Commons Conservancy | |
| // SPDX-License-Identifier: Apache-2.0 | |
| // SPDX-License-Identifier: MIT | |
| use serde::{Serialize, Serializer}; | |
| use thiserror::Error; | |
| /// All errors that can occur while running the updater. | |
| pub enum Error { | |
| /// Endpoints are not sent. | |
| EmptyEndpoints, | |
| /// IO errors. | |
| Io( std::io::Error), | |
| /// Semver errors. | |
| Semver( semver::Error), | |
| /// Serialization errors. | |
| Serialization( serde_json::Error), | |
| /// Could not fetch a valid response from the server. | |
| ReleaseNotFound, | |
| /// Unsupported app architecture. | |
| UnsupportedArch, | |
| /// Operating system is not supported. | |
| UnsupportedOs, | |
| /// Failed to determine updater package extract path | |
| FailedToDetermineExtractPath, | |
| /// Url parsing errors. | |
| UrlParse( url::ParseError), | |
| /// `reqwest` crate errors. | |
| Reqwest( reqwest::Error), | |
| /// The platform was not found in the updater JSON response. | |
| TargetNotFound(String), | |
| /// Neither the platform nor the fallback platform was found in the updater JSON response. | |
| TargetsNotFound(Vec<String>), | |
| /// Download failed | |
| Network(String), | |
| /// `minisign_verify` errors. | |
| Minisign( minisign_verify::Error), | |
| /// `base64` errors. | |
| Base64( base64::DecodeError), | |
| /// UTF8 Errors in signature. | |
| SignatureUtf8(String), | |
| /// `zip` errors. | |
| Extract( zip::result::ZipError), | |
| /// Temp dir is not on same mount mount. This prevents our updater to rename the AppImage to a temp file. | |
| TempDirNotOnSameMountPoint, | |
| BinaryNotFoundInArchive, | |
| TempDirNotFound, | |
| AuthenticationFailed, | |
| DebInstallFailed, | |
| PackageInstallFailed, | |
| InvalidUpdaterFormat, | |
| Http( http::Error), | |
| InvalidHeaderValue( http::header::InvalidHeaderValue), | |
| InvalidHeaderName( http::header::InvalidHeaderName), | |
| FormatDate, | |
| /// The configured updater endpoint must use a secure protocol like `https` | |
| InsecureTransportProtocol, | |
| Tauri( tauri::Error), | |
| } | |
| impl Serialize for Error { | |
| fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error> | |
| where | |
| S: Serializer, | |
| { | |
| serializer.serialize_str(self.to_string().as_ref()) | |
| } | |
| } | |
| pub type Result<T> = std::result::Result<T, Error>; | |