updated the SDK (#3737)

This commit is contained in:
Mauro
2025-02-04 17:57:39 +01:00
committed by GitHub
parent 437d16792d
commit 63d059b342
8 changed files with 36 additions and 75 deletions

View File

@@ -131,12 +131,9 @@ class AuthenticationService: AuthenticationServiceProtocol {
}
return await userSession(for: client)
} catch {
MXLog.error("Failed logging in with error: \(error)")
// FIXME: How about we make a proper type in the FFI? 😅
guard let error = error as? ClientError else { return .failure(.failedLoggingIn) }
switch error.code {
} catch let ClientError.MatrixApi(errorKind, _, _) {
MXLog.error("Failed logging in with error kind: \(errorKind)")
switch errorKind {
case .forbidden:
return .failure(.invalidCredentials)
case .userDeactivated:
@@ -144,6 +141,9 @@ class AuthenticationService: AuthenticationServiceProtocol {
default:
return .failure(.failedLoggingIn)
}
} catch {
MXLog.error("Failed logging in with error: \(error)")
return .failure(.failedLoggingIn)
}
}