atagen

macltok

public
Star0
Watch0
0bfa3f46f0be39529f9541bdfbff51255e54ffba
3
ssh://brewery@pls.lobotomise.me:33/atagen/macltok.git

Blame: src/error.rs

31ce2453c82fatagen2026-09-24 13:07 UTC1
use std::sync::Arc;
96fdf90aacd6atagen2026-09-08 08:24 UTC2
96fdf90aacd6atagen2026-09-08 08:24 UTC3
use matrix_sdk::{
1fe480c16a3catagen2026-09-26 08:44 UTC4
    HttpError, RefreshTokenError, SendOutsideWasm, SyncOutsideWasm,
96fdf90aacd6atagen2026-09-08 08:24 UTC5
    authentication::oauth::error::{
96fdf90aacd6atagen2026-09-08 08:24 UTC6
        OAuthAuthorizationCodeError, OAuthDiscoveryError, OAuthError, OAuthTokenRevocationError,
96fdf90aacd6atagen2026-09-08 08:24 UTC7
        RequestTokenError,
96fdf90aacd6atagen2026-09-08 08:24 UTC8
    },
96fdf90aacd6atagen2026-09-08 08:24 UTC9
    encryption::{
96fdf90aacd6atagen2026-09-08 08:24 UTC10
        identities::{ManualVerifyError, RequestVerificationError},
96fdf90aacd6atagen2026-09-08 08:24 UTC11
        recovery::RecoveryError,
96fdf90aacd6atagen2026-09-08 08:24 UTC12
        secret_storage::{ImportError, SecretStorageError},
96fdf90aacd6atagen2026-09-08 08:24 UTC13
    },
96fdf90aacd6atagen2026-09-08 08:24 UTC14
};
31ce2453c82fatagen2026-09-24 13:07 UTC15
#[cfg(feature = "serde")]
31ce2453c82fatagen2026-09-24 13:07 UTC16
use serde::{Deserialize, Serialize};
96fdf90aacd6atagen2026-09-08 08:24 UTC17
31ce2453c82fatagen2026-09-24 13:07 UTC18
use crate::InteractiveAuthChallenge;
96fdf90aacd6atagen2026-09-08 08:24 UTC19
1fe480c16a3catagen2026-09-26 08:44 UTC20
/// the sdk's `SendOutsideWasm` isn't an auto trait, so it can't go in a trait object
1fe480c16a3catagen2026-09-26 08:44 UTC21
#[cfg(not(target_family = "wasm"))]
62fe32759529atagen2026-09-26 08:50 UTC22
pub(crate) type SourceError = dyn std::error::Error + Send + Sync;
1fe480c16a3catagen2026-09-26 08:44 UTC23
#[cfg(target_family = "wasm")]
62fe32759529atagen2026-09-26 08:50 UTC24
pub(crate) type SourceError = dyn std::error::Error;
1fe480c16a3catagen2026-09-26 08:44 UTC25
31ce2453c82fatagen2026-09-24 13:07 UTC26
/// the one thing that goes wrong, for commands and queries alike. match on `kind`, show `message`
31ce2453c82fatagen2026-09-24 13:07 UTC27
#[derive(Clone, Debug, thiserror::Error)]
31ce2453c82fatagen2026-09-24 13:07 UTC28
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
96fdf90aacd6atagen2026-09-08 08:24 UTC29
#[error("{message}")]
31ce2453c82fatagen2026-09-24 13:07 UTC30
#[non_exhaustive]
31ce2453c82fatagen2026-09-24 13:07 UTC31
pub struct Error {
31ce2453c82fatagen2026-09-24 13:07 UTC32
    pub kind: ErrorKind,
31ce2453c82fatagen2026-09-24 13:07 UTC33
    pub message: String,
31ce2453c82fatagen2026-09-24 13:07 UTC34
    /// set when the server wants interactive auth before it'll do the thing
31ce2453c82fatagen2026-09-24 13:07 UTC35
    pub challenge: Option<Box<InteractiveAuthChallenge>>,
96fdf90aacd6atagen2026-09-08 08:24 UTC36
    #[source]
31ce2453c82fatagen2026-09-24 13:07 UTC37
    #[cfg_attr(feature = "serde", serde(skip))]
1fe480c16a3catagen2026-09-26 08:44 UTC38
    source: Option<Arc<SourceError>>,
96fdf90aacd6atagen2026-09-08 08:24 UTC39
}
96fdf90aacd6atagen2026-09-08 08:24 UTC40
31ce2453c82fatagen2026-09-24 13:07 UTC41
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
31ce2453c82fatagen2026-09-24 13:07 UTC42
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31ce2453c82fatagen2026-09-24 13:07 UTC43
#[non_exhaustive]
31ce2453c82fatagen2026-09-24 13:07 UTC44
pub enum ErrorKind {
31ce2453c82fatagen2026-09-24 13:07 UTC45
    /// the engine stopped, or the task doing the work died, before answering
31ce2453c82fatagen2026-09-24 13:07 UTC46
    Interrupted,
31ce2453c82fatagen2026-09-24 13:07 UTC47
    Unauthenticated,
31ce2453c82fatagen2026-09-24 13:07 UTC48
    InteractiveAuthRequired,
31ce2453c82fatagen2026-09-24 13:07 UTC49
    Invalid,
31ce2453c82fatagen2026-09-24 13:07 UTC50
    RoomUnknown,
31ce2453c82fatagen2026-09-24 13:07 UTC51
    RoomNotOpen,
31ce2453c82fatagen2026-09-24 13:07 UTC52
    TimelineNotOpen,
31ce2453c82fatagen2026-09-24 13:07 UTC53
    RoomBusy,
31ce2453c82fatagen2026-09-24 13:07 UTC54
    QueueFull,
31ce2453c82fatagen2026-09-24 13:07 UTC55
    EmptyBody,
31ce2453c82fatagen2026-09-24 13:07 UTC56
    MediaUnknown,
31ce2453c82fatagen2026-09-24 13:07 UTC57
    MediaTooLarge,
31ce2453c82fatagen2026-09-24 13:07 UTC58
    MediaUnavailable,
31ce2453c82fatagen2026-09-24 13:07 UTC59
    VerificationInactive,
31ce2453c82fatagen2026-09-24 13:07 UTC60
    VerificationUnsupported,
31ce2453c82fatagen2026-09-24 13:07 UTC61
    NoCrossSigningIdentity,
31ce2453c82fatagen2026-09-24 13:07 UTC62
    RecoveryRejected,
31ce2453c82fatagen2026-09-24 13:07 UTC63
    Network,
31ce2453c82fatagen2026-09-24 13:07 UTC64
    Server,
31ce2453c82fatagen2026-09-24 13:07 UTC65
    Store,
31ce2453c82fatagen2026-09-24 13:07 UTC66
    Timeline,
31ce2453c82fatagen2026-09-24 13:07 UTC67
    Encryption,
31ce2453c82fatagen2026-09-24 13:07 UTC68
    Other,
31ce2453c82fatagen2026-09-24 13:07 UTC69
}
31ce2453c82fatagen2026-09-24 13:07 UTC70
31ce2453c82fatagen2026-09-24 13:07 UTC71
impl Error {
31ce2453c82fatagen2026-09-24 13:07 UTC72
    pub(crate) fn new(kind: ErrorKind, message: impl Into<String>) -> Self {
96fdf90aacd6atagen2026-09-08 08:24 UTC73
        Self {
96fdf90aacd6atagen2026-09-08 08:24 UTC74
            kind,
96fdf90aacd6atagen2026-09-08 08:24 UTC75
            message: message.into(),
31ce2453c82fatagen2026-09-24 13:07 UTC76
            challenge: None,
96fdf90aacd6atagen2026-09-08 08:24 UTC77
            source: None,
96fdf90aacd6atagen2026-09-08 08:24 UTC78
        }
96fdf90aacd6atagen2026-09-08 08:24 UTC79
    }
96fdf90aacd6atagen2026-09-08 08:24 UTC80
96fdf90aacd6atagen2026-09-08 08:24 UTC81
    pub(crate) fn with_source(
31ce2453c82fatagen2026-09-24 13:07 UTC82
        kind: ErrorKind,
96fdf90aacd6atagen2026-09-08 08:24 UTC83
        message: impl Into<String>,
1fe480c16a3catagen2026-09-26 08:44 UTC84
        source: impl std::error::Error + SendOutsideWasm + SyncOutsideWasm + 'static,
96fdf90aacd6atagen2026-09-08 08:24 UTC85
    ) -> Self {
96fdf90aacd6atagen2026-09-08 08:24 UTC86
        Self {
31ce2453c82fatagen2026-09-24 13:07 UTC87
            source: Some(Arc::new(source)),
31ce2453c82fatagen2026-09-24 13:07 UTC88
            ..Self::new(kind, message)
31ce2453c82fatagen2026-09-24 13:07 UTC89
        }
31ce2453c82fatagen2026-09-24 13:07 UTC90
    }
31ce2453c82fatagen2026-09-24 13:07 UTC91
31ce2453c82fatagen2026-09-24 13:07 UTC92
    pub(crate) fn interrupted() -> Self {
31ce2453c82fatagen2026-09-24 13:07 UTC93
        Self::new(
31ce2453c82fatagen2026-09-24 13:07 UTC94
            ErrorKind::Interrupted,
31ce2453c82fatagen2026-09-24 13:07 UTC95
            "the engine stopped before the operation finished",
31ce2453c82fatagen2026-09-24 13:07 UTC96
        )
31ce2453c82fatagen2026-09-24 13:07 UTC97
    }
31ce2453c82fatagen2026-09-24 13:07 UTC98
31ce2453c82fatagen2026-09-24 13:07 UTC99
    pub(crate) fn room_unknown() -> Self {
31ce2453c82fatagen2026-09-24 13:07 UTC100
        Self::new(
31ce2453c82fatagen2026-09-24 13:07 UTC101
            ErrorKind::RoomUnknown,
31ce2453c82fatagen2026-09-24 13:07 UTC102
            "room is not available in the local store",
31ce2453c82fatagen2026-09-24 13:07 UTC103
        )
31ce2453c82fatagen2026-09-24 13:07 UTC104
    }
31ce2453c82fatagen2026-09-24 13:07 UTC105
31ce2453c82fatagen2026-09-24 13:07 UTC106
    pub(crate) fn interactive_auth(challenge: InteractiveAuthChallenge) -> Self {
31ce2453c82fatagen2026-09-24 13:07 UTC107
        Self {
31ce2453c82fatagen2026-09-24 13:07 UTC108
            challenge: Some(Box::new(challenge)),
31ce2453c82fatagen2026-09-24 13:07 UTC109
            ..Self::new(
31ce2453c82fatagen2026-09-24 13:07 UTC110
                ErrorKind::InteractiveAuthRequired,
31ce2453c82fatagen2026-09-24 13:07 UTC111
                "interactive authentication is required",
31ce2453c82fatagen2026-09-24 13:07 UTC112
            )
96fdf90aacd6atagen2026-09-08 08:24 UTC113
        }
96fdf90aacd6atagen2026-09-08 08:24 UTC114
    }
96fdf90aacd6atagen2026-09-08 08:24 UTC115
96fdf90aacd6atagen2026-09-08 08:24 UTC116
    pub(crate) fn from_sdk(message: impl Into<String>, source: matrix_sdk::Error) -> Self {
96fdf90aacd6atagen2026-09-08 08:24 UTC117
        Self::with_source(classify_sdk_error(&source), message, source)
96fdf90aacd6atagen2026-09-08 08:24 UTC118
    }
96fdf90aacd6atagen2026-09-08 08:24 UTC119
96fdf90aacd6atagen2026-09-08 08:24 UTC120
    pub(crate) fn from_http(message: impl Into<String>, source: HttpError) -> Self {
96fdf90aacd6atagen2026-09-08 08:24 UTC121
        Self::with_source(classify_http_error(&source), message, source)
96fdf90aacd6atagen2026-09-08 08:24 UTC122
    }
31ce2453c82fatagen2026-09-24 13:07 UTC123
96fdf90aacd6atagen2026-09-08 08:24 UTC124
    pub(crate) fn from_refresh_token(
96fdf90aacd6atagen2026-09-08 08:24 UTC125
        message: impl Into<String>,
96fdf90aacd6atagen2026-09-08 08:24 UTC126
        source: RefreshTokenError,
96fdf90aacd6atagen2026-09-08 08:24 UTC127
    ) -> Self {
96fdf90aacd6atagen2026-09-08 08:24 UTC128
        Self::with_source(classify_refresh_token_error(&source), message, source)
96fdf90aacd6atagen2026-09-08 08:24 UTC129
    }
96fdf90aacd6atagen2026-09-08 08:24 UTC130
96fdf90aacd6atagen2026-09-08 08:24 UTC131
    pub(crate) fn from_recovery(message: impl Into<String>, source: RecoveryError) -> Self {
96fdf90aacd6atagen2026-09-08 08:24 UTC132
        let kind = match &source {
96fdf90aacd6atagen2026-09-08 08:24 UTC133
            RecoveryError::Sdk(source) => classify_sdk_error(source),
96fdf90aacd6atagen2026-09-08 08:24 UTC134
            RecoveryError::SecretStorage(SecretStorageError::Sdk(source)) => {
96fdf90aacd6atagen2026-09-08 08:24 UTC135
                classify_sdk_error(source)
96fdf90aacd6atagen2026-09-08 08:24 UTC136
            }
96fdf90aacd6atagen2026-09-08 08:24 UTC137
            RecoveryError::SecretStorage(SecretStorageError::ImportError { error, .. }) => {
96fdf90aacd6atagen2026-09-08 08:24 UTC138
                match error {
96fdf90aacd6atagen2026-09-08 08:24 UTC139
                    ImportError::Sdk(source) => classify_sdk_error(source),
31ce2453c82fatagen2026-09-24 13:07 UTC140
                    _ => ErrorKind::RecoveryRejected,
96fdf90aacd6atagen2026-09-08 08:24 UTC141
                }
96fdf90aacd6atagen2026-09-08 08:24 UTC142
            }
96fdf90aacd6atagen2026-09-08 08:24 UTC143
            RecoveryError::SecretStorage(SecretStorageError::Verification(source)) => {
96fdf90aacd6atagen2026-09-08 08:24 UTC144
                match source {
96fdf90aacd6atagen2026-09-08 08:24 UTC145
                    ManualVerifyError::Http(source) => classify_http_error(source),
31ce2453c82fatagen2026-09-24 13:07 UTC146
                    _ => ErrorKind::RecoveryRejected,
96fdf90aacd6atagen2026-09-08 08:24 UTC147
                }
96fdf90aacd6atagen2026-09-08 08:24 UTC148
            }
96fdf90aacd6atagen2026-09-08 08:24 UTC149
            RecoveryError::SecretStorage(SecretStorageError::SecretStorageKey(_)) => {
31ce2453c82fatagen2026-09-24 13:07 UTC150
                ErrorKind::RecoveryRejected
96fdf90aacd6atagen2026-09-08 08:24 UTC151
            }
31ce2453c82fatagen2026-09-24 13:07 UTC152
            RecoveryError::SecretStorage(SecretStorageError::Storage(_)) => ErrorKind::Store,
96fdf90aacd6atagen2026-09-08 08:24 UTC153
            RecoveryError::BackupExistsOnServer | RecoveryError::SecretStorage(_) => {
31ce2453c82fatagen2026-09-24 13:07 UTC154
                ErrorKind::RecoveryRejected
96fdf90aacd6atagen2026-09-08 08:24 UTC155
            }
96fdf90aacd6atagen2026-09-08 08:24 UTC156
        };
96fdf90aacd6atagen2026-09-08 08:24 UTC157
        Self::with_source(kind, message, source)
96fdf90aacd6atagen2026-09-08 08:24 UTC158
    }
96fdf90aacd6atagen2026-09-08 08:24 UTC159
96fdf90aacd6atagen2026-09-08 08:24 UTC160
    pub(crate) fn from_verification_request(
96fdf90aacd6atagen2026-09-08 08:24 UTC161
        message: impl Into<String>,
96fdf90aacd6atagen2026-09-08 08:24 UTC162
        source: RequestVerificationError,
96fdf90aacd6atagen2026-09-08 08:24 UTC163
    ) -> Self {
96fdf90aacd6atagen2026-09-08 08:24 UTC164
        let kind = match &source {
96fdf90aacd6atagen2026-09-08 08:24 UTC165
            RequestVerificationError::Sdk(source) => classify_sdk_error(source),
31ce2453c82fatagen2026-09-24 13:07 UTC166
            RequestVerificationError::RoomCreation(_) => ErrorKind::Encryption,
96fdf90aacd6atagen2026-09-08 08:24 UTC167
        };
96fdf90aacd6atagen2026-09-08 08:24 UTC168
        Self::with_source(kind, message, source)
96fdf90aacd6atagen2026-09-08 08:24 UTC169
    }
96fdf90aacd6atagen2026-09-08 08:24 UTC170
}
96fdf90aacd6atagen2026-09-08 08:24 UTC171
31ce2453c82fatagen2026-09-24 13:07 UTC172
impl PartialEq for Error {
31ce2453c82fatagen2026-09-24 13:07 UTC173
    fn eq(&self, other: &Self) -> bool {
31ce2453c82fatagen2026-09-24 13:07 UTC174
        self.kind == other.kind
31ce2453c82fatagen2026-09-24 13:07 UTC175
            && self.message == other.message
31ce2453c82fatagen2026-09-24 13:07 UTC176
            && self.challenge == other.challenge
31ce2453c82fatagen2026-09-24 13:07 UTC177
    }
31ce2453c82fatagen2026-09-24 13:07 UTC178
}
31ce2453c82fatagen2026-09-24 13:07 UTC179
31ce2453c82fatagen2026-09-24 13:07 UTC180
pub(crate) fn classify_sdk_error(source: &matrix_sdk::Error) -> ErrorKind {
96fdf90aacd6atagen2026-09-08 08:24 UTC181
    match source {
96fdf90aacd6atagen2026-09-08 08:24 UTC182
        matrix_sdk::Error::Http(source) => classify_http_error(source),
96fdf90aacd6atagen2026-09-08 08:24 UTC183
        matrix_sdk::Error::OAuth(source) => classify_oauth_error(source),
31ce2453c82fatagen2026-09-24 13:07 UTC184
        matrix_sdk::Error::AuthenticationRequired => ErrorKind::Unauthenticated,
96fdf90aacd6atagen2026-09-08 08:24 UTC185
        matrix_sdk::Error::BadCryptoStoreState
96fdf90aacd6atagen2026-09-08 08:24 UTC186
        | matrix_sdk::Error::CryptoStoreError(_)
96fdf90aacd6atagen2026-09-08 08:24 UTC187
        | matrix_sdk::Error::CrossProcessLockError(_)
96fdf90aacd6atagen2026-09-08 08:24 UTC188
        | matrix_sdk::Error::StateStore(_)
96fdf90aacd6atagen2026-09-08 08:24 UTC189
        | matrix_sdk::Error::EventCacheStore(_)
31ce2453c82fatagen2026-09-24 13:07 UTC190
        | matrix_sdk::Error::MediaStore(_) => ErrorKind::Store,
96fdf90aacd6atagen2026-09-08 08:24 UTC191
        matrix_sdk::Error::NoOlmMachine
96fdf90aacd6atagen2026-09-08 08:24 UTC192
        | matrix_sdk::Error::OlmError(_)
96fdf90aacd6atagen2026-09-08 08:24 UTC193
        | matrix_sdk::Error::MegolmError(_)
31ce2453c82fatagen2026-09-24 13:07 UTC194
        | matrix_sdk::Error::DecryptorError(_) => ErrorKind::Encryption,
31ce2453c82fatagen2026-09-24 13:07 UTC195
        matrix_sdk::Error::Media(_) => ErrorKind::MediaUnavailable,
31ce2453c82fatagen2026-09-24 13:07 UTC196
        matrix_sdk::Error::Timeout => ErrorKind::Network,
31ce2453c82fatagen2026-09-24 13:07 UTC197
        _ => ErrorKind::Other,
96fdf90aacd6atagen2026-09-08 08:24 UTC198
    }
96fdf90aacd6atagen2026-09-08 08:24 UTC199
}
96fdf90aacd6atagen2026-09-08 08:24 UTC200
31ce2453c82fatagen2026-09-24 13:07 UTC201
fn classify_http_error(source: &HttpError) -> ErrorKind {
96fdf90aacd6atagen2026-09-08 08:24 UTC202
    match source {
31ce2453c82fatagen2026-09-24 13:07 UTC203
        HttpError::Reqwest(_) => ErrorKind::Network,
31ce2453c82fatagen2026-09-24 13:07 UTC204
        HttpError::Api(_) => ErrorKind::Server,
96fdf90aacd6atagen2026-09-08 08:24 UTC205
        HttpError::RefreshToken(source) => classify_refresh_token_error(source),
96fdf90aacd6atagen2026-09-08 08:24 UTC206
        HttpError::Cached(source) => classify_http_error(source),
31ce2453c82fatagen2026-09-24 13:07 UTC207
        _ => ErrorKind::Other,
96fdf90aacd6atagen2026-09-08 08:24 UTC208
    }
96fdf90aacd6atagen2026-09-08 08:24 UTC209
}
96fdf90aacd6atagen2026-09-08 08:24 UTC210
31ce2453c82fatagen2026-09-24 13:07 UTC211
fn classify_refresh_token_error(source: &RefreshTokenError) -> ErrorKind {
96fdf90aacd6atagen2026-09-08 08:24 UTC212
    match source {
31ce2453c82fatagen2026-09-24 13:07 UTC213
        RefreshTokenError::RefreshTokenRequired => ErrorKind::Unauthenticated,
96fdf90aacd6atagen2026-09-08 08:24 UTC214
        RefreshTokenError::MatrixAuth(source) => classify_http_error(source),
96fdf90aacd6atagen2026-09-08 08:24 UTC215
        RefreshTokenError::OAuth(source) => classify_oauth_error(source),
96fdf90aacd6atagen2026-09-08 08:24 UTC216
    }
96fdf90aacd6atagen2026-09-08 08:24 UTC217
}
96fdf90aacd6atagen2026-09-08 08:24 UTC218
31ce2453c82fatagen2026-09-24 13:07 UTC219
fn classify_oauth_error(source: &OAuthError) -> ErrorKind {
96fdf90aacd6atagen2026-09-08 08:24 UTC220
    let classify_token_request_error = |source: &_| match source {
31ce2453c82fatagen2026-09-24 13:07 UTC221
        RequestTokenError::Request(_) => ErrorKind::Network,
31ce2453c82fatagen2026-09-24 13:07 UTC222
        RequestTokenError::ServerResponse(_) => ErrorKind::Unauthenticated,
31ce2453c82fatagen2026-09-24 13:07 UTC223
        _ => ErrorKind::Other,
96fdf90aacd6atagen2026-09-08 08:24 UTC224
    };
96fdf90aacd6atagen2026-09-08 08:24 UTC225
    match source {
96fdf90aacd6atagen2026-09-08 08:24 UTC226
        OAuthError::Discovery(source) => match source {
96fdf90aacd6atagen2026-09-08 08:24 UTC227
            OAuthDiscoveryError::Http(source) => classify_http_error(source),
96fdf90aacd6atagen2026-09-08 08:24 UTC228
            OAuthDiscoveryError::Oidc(source) => classify_token_request_error(source),
31ce2453c82fatagen2026-09-24 13:07 UTC229
            _ => ErrorKind::Unauthenticated,
96fdf90aacd6atagen2026-09-08 08:24 UTC230
        },
96fdf90aacd6atagen2026-09-08 08:24 UTC231
        OAuthError::RefreshToken(source) => classify_token_request_error(source),
96fdf90aacd6atagen2026-09-08 08:24 UTC232
        OAuthError::AuthorizationCode(OAuthAuthorizationCodeError::RequestToken(source)) => {
96fdf90aacd6atagen2026-09-08 08:24 UTC233
            classify_token_request_error(source)
96fdf90aacd6atagen2026-09-08 08:24 UTC234
        }
31ce2453c82fatagen2026-09-24 13:07 UTC235
        OAuthError::AuthorizationCode(_) => ErrorKind::Unauthenticated,
96fdf90aacd6atagen2026-09-08 08:24 UTC236
        OAuthError::Logout(source) => match source {
31ce2453c82fatagen2026-09-24 13:07 UTC237
            OAuthTokenRevocationError::Revoke(RequestTokenError::Request(_)) => ErrorKind::Network,
96fdf90aacd6atagen2026-09-08 08:24 UTC238
            OAuthTokenRevocationError::Revoke(RequestTokenError::ServerResponse(_)) => {
31ce2453c82fatagen2026-09-24 13:07 UTC239
                ErrorKind::Unauthenticated
96fdf90aacd6atagen2026-09-08 08:24 UTC240
            }
31ce2453c82fatagen2026-09-24 13:07 UTC241
            _ => ErrorKind::Other,
96fdf90aacd6atagen2026-09-08 08:24 UTC242
        },
31ce2453c82fatagen2026-09-24 13:07 UTC243
        _ => ErrorKind::Unauthenticated,
96fdf90aacd6atagen2026-09-08 08:24 UTC244
    }
96fdf90aacd6atagen2026-09-08 08:24 UTC245
}