Enum patchify::client::UpdaterError
source · #[non_exhaustive]pub enum UpdaterError {
Show 20 variants
FailedHashVerification(Version),
FailedSignatureVerification(Url),
HttpError(Url, StatusCode),
HttpRequestFailed(Url, String),
InvalidBody(Url),
InvalidPayload(Url),
InvalidSignature(Url, String),
InvalidUrl(Url, String),
MissingData(Url, usize, usize),
MissingSignature(Url),
TooMuchData(Url, usize, usize),
UnableToCreateDownload(PathBuf, String),
UnableToCreateTempDir(String),
UnableToGetFileMetadata(PathBuf, String),
UnableToMoveNewExe(PathBuf, String),
UnableToObtainCurrentExePath(String),
UnableToRenameCurrentExe(PathBuf, String),
UnableToSetFilePermissions(PathBuf, String),
UnableToWriteToDownload(PathBuf, String),
UnexpectedContentType(Url, String, String),
}
Expand description
Errors that can occur when trying to update.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
FailedHashVerification(Version)
Verification of the SHA256 hash of the downloaded file against the server’s hash data failed.
FailedSignatureVerification(Url)
Verification of the HTTP response body against the signature header using the configured public key failed.
HttpError(Url, StatusCode)
An HTTP error occurred, i.e. the status code returned is not 200
. No
other codes are expected, as this library only performs GET
requests.
HttpRequestFailed(Url, String)
The HTTP request to the API server failed.
InvalidBody(Url)
The response from the API server could not be decoded. This could be due to malformed text that is not valid UTF-8 for endpoints that return text or JSON, or a truncated response.
InvalidPayload(Url)
The response from the API server could not be parsed. This could be due to invalid JSON, or the JSON not matching the expected structure.
InvalidSignature(Url, String)
The signature header from the API server could not be decoded.
InvalidUrl(Url, String)
The URL specified to use to make an HTTP request is invalid. The API URL should be okay due to type validation, so something must have happened when adding a particular endpoint to it, as the outcome is invalid.
MissingData(Url, usize, usize)
The HTTP response body from the API server is shorter than expected.
MissingSignature(Url)
The HTTP response from the API server does not contain a signature header.
TooMuchData(Url, usize, usize)
The HTTP response body from the API server is longer than expected.
UnableToCreateDownload(PathBuf, String)
A problem was encountered when trying to create a file for the download.
UnableToCreateTempDir(String)
A problem was encountered when trying to create a temporary directory.
UnableToGetFileMetadata(PathBuf, String)
A problem was encountered when trying to get the metadata for the new executable.
UnableToMoveNewExe(PathBuf, String)
A problem was encountered when trying to move the new executable into the place of the current running application.
UnableToObtainCurrentExePath(String)
A problem was encountered when trying to obtain the path of the current running application.
UnableToRenameCurrentExe(PathBuf, String)
A problem was encountered when trying to rename the current running application.
UnableToSetFilePermissions(PathBuf, String)
A problem was encountered when trying to set the new executable’s file permissions.
UnableToWriteToDownload(PathBuf, String)
A problem was encountered when trying to write to the download file.
UnexpectedContentType(Url, String, String)
The content type of the response is not as expected.
Trait Implementations§
source§impl Clone for UpdaterError
impl Clone for UpdaterError
source§fn clone(&self) -> UpdaterError
fn clone(&self) -> UpdaterError
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for UpdaterError
impl Debug for UpdaterError
source§impl Display for UpdaterError
impl Display for UpdaterError
source§impl Error for UpdaterError
impl Error for UpdaterError
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
source§impl PartialEq for UpdaterError
impl PartialEq for UpdaterError
source§fn eq(&self, other: &UpdaterError) -> bool
fn eq(&self, other: &UpdaterError) -> bool
self
and other
values to be equal, and is used
by ==
.impl Eq for UpdaterError
impl StructuralPartialEq for UpdaterError
Auto Trait Implementations§
impl Freeze for UpdaterError
impl RefUnwindSafe for UpdaterError
impl Send for UpdaterError
impl Sync for UpdaterError
impl Unpin for UpdaterError
impl UnwindSafe for UpdaterError
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.