refactor: upgrade tauri 2.0

This commit is contained in:
Kevin Yue committed 2024-12-26 21:50:39 +08:00
1 parent 0f67be465b
commit 8f8ad466f4
73 files changed
+7232 -5026

No files matched your search

+19 -1
View File
@@ -7,7 +7,19 @@ pub enum PortalError {
#[error("Portal config error: {0}")]
ConfigError(String),
#[error("Network error: {0}")]
NetworkError(String),
NetworkError(#[from] reqwest::Error),
#[error("TLS error")]
TlsError,
}
impl PortalError {
pub fn is_legacy_openssl_error(&self) -> bool {
format!("{:?}", self).contains("unsafe legacy renegotiation")
}
pub fn is_tls_error(&self) -> bool {
matches!(self, PortalError::TlsError) || format!("{:?}", self).contains("certificate verify failed")
}
}
#[derive(Error, Debug)]
@@ -17,3 +29,9 @@ pub enum AuthDataParseError {
#[error("Invalid auth data")]
Invalid,
}
impl AuthDataParseError {
pub fn is_invalid(&self) -> bool {
matches!(self, AuthDataParseError::Invalid)
}
}