diff --git a/FlowCrypt/Functionality/Mail Provider/MessagesList Provider/Model/MessageLabel.swift b/FlowCrypt/Functionality/Mail Provider/MessagesList Provider/Model/MessageLabel.swift index aff11ca6e..6d803dc8c 100644 --- a/FlowCrypt/Functionality/Mail Provider/MessagesList Provider/Model/MessageLabel.swift +++ b/FlowCrypt/Functionality/Mail Provider/MessagesList Provider/Model/MessageLabel.swift @@ -83,7 +83,7 @@ extension MessageLabelType { case .label("submited"): return MCOMessageFlag.submitted.rawValue case .none: return 0 default: - assertionFailure("This label \(self) is not supported byt his provider") + assertionFailure("This label \(self) is not supported by this provider") return 0 } } diff --git a/FlowCrypt/Functionality/Services/EnterpriseServerApi.swift b/FlowCrypt/Functionality/Services/EnterpriseServerApi.swift index e802ece1b..d2fdb4e5c 100644 --- a/FlowCrypt/Functionality/Services/EnterpriseServerApi.swift +++ b/FlowCrypt/Functionality/Services/EnterpriseServerApi.swift @@ -119,8 +119,7 @@ class EnterpriseServerApi: EnterpriseServerApiType { func getClientConfigurationForCurrentUser() -> Promise { guard let email = DataService.shared.currentUser?.email else { return Promise { _, reject in - assertionFailure("User has to be set while getting client configuration") - reject(AppErr.user("currentUser == nil")) + fatalError("User has to be set while getting client configuration") } } return getClientConfiguration(for: email) diff --git a/FlowCrypt/Functionality/Services/GoogleUserService.swift b/FlowCrypt/Functionality/Services/GoogleUserService.swift index cc9ef413a..75acc3da6 100644 --- a/FlowCrypt/Functionality/Services/GoogleUserService.swift +++ b/FlowCrypt/Functionality/Services/GoogleUserService.swift @@ -106,7 +106,7 @@ extension GoogleUserService: UserServiceType { } else if let error = error { reject(error) } else { - assertionFailure() + fatalError("Shouldn't happe because covered received non nil error and non nil authState") } } @@ -155,15 +155,11 @@ extension GoogleUserService { completion: @escaping ((Result) -> Void) ) { guard let authorization = authorization else { - assertionFailure("authorization should not be nil at this point") - completion(.failure(.missedAuthorization)) - return + fatalError("authorization should not be nil at this point") } guard let userInfoEndpoint = URL(string: "https://www.googleapis.com/oauth2/v3/userinfo") else { - assertionFailure("userInfoEndpoint should not be nil") - completion(.failure(.invalidUserEndpoint)) - return + fatalError("userInfoEndpoint could not be nil because it's hardcoded string url") } let fetcherService = GTMSessionFetcherService() diff --git a/FlowCrypt/Functionality/Services/Organisational Rules Service/OrganisationalRulesService.swift b/FlowCrypt/Functionality/Services/Organisational Rules Service/OrganisationalRulesService.swift index 3f1d15ee6..a51556851 100644 --- a/FlowCrypt/Functionality/Services/Organisational Rules Service/OrganisationalRulesService.swift +++ b/FlowCrypt/Functionality/Services/Organisational Rules Service/OrganisationalRulesService.swift @@ -69,8 +69,7 @@ extension OrganisationalRulesService: OrganisationalRulesServiceType { func getSavedOrganisationalRulesForCurrentUser() -> OrganisationalRules { guard let configuration = self.clientConfigurationProvider.fetch() else { - assertionFailure("There should not be a user without OrganisationalRules") - return OrganisationalRules(clientConfiguration: .empty) + fatalError("There should not be a user without OrganisationalRules") } return OrganisationalRules(clientConfiguration: configuration)