Files
letro-ios/ElementX/Sources/Services/Client/ClientError.swift
Doug 5a1b9463bc #40: Use the Rust AuthenticationService.
* Update SDK package to 1.0.12-alpha.
* Use an app group for storage and stop stripping the http from the homeserver when configuring the service.
* Rename access token to restore token.
* Remove matrix.org server description inline with latest FTUE changes.
2022-07-27 10:57:16 +01:00

31 lines
669 B
Swift

//
// ClientError.swift
// ElementX
//
// Created by Doug on 30/06/2022.
// Copyright © 2022 Element. All rights reserved.
//
import Foundation
import MatrixRustSDK
enum MatrixErrorCode: String, CaseIterable {
case unknown = "M_UNKNOWN"
case userDeactivated = "M_USER_DEACTIVATED"
case forbidden = "M_FORBIDDEN"
}
extension AuthenticationError {
var code: MatrixErrorCode {
guard case let .Generic(message) = self else { return .unknown }
for code in MatrixErrorCode.allCases {
if message.contains(code.rawValue) {
return code
}
}
return .unknown
}
}