From cf66af6f2e7c69a3e0712317f8473ab09711d426 Mon Sep 17 00:00:00 2001 From: manuroe Date: Mon, 14 Nov 2016 16:54:51 +0100 Subject: OLMKit: Replaced NSAsserts by NSErrors --- xcode/OLMKit/OLMAccount.m | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'xcode/OLMKit/OLMAccount.m') diff --git a/xcode/OLMKit/OLMAccount.m b/xcode/OLMKit/OLMAccount.m index 085b487..4830995 100644 --- a/xcode/OLMKit/OLMAccount.m +++ b/xcode/OLMKit/OLMAccount.m @@ -151,7 +151,7 @@ size_t result = olm_remove_one_time_keys(self.account, session.session); if (result == olm_error()) { const char *error = olm_account_last_error(_account); - NSAssert(NO, @"olm_remove_one_time_keys error: %s", error); + NSLog(@"olm_remove_one_time_keys error: %s", error); return NO; } return YES; @@ -174,7 +174,7 @@ NSParameterAssert(serializedData.length > 0); if (key.length == 0 || serializedData.length == 0) { if (error) { - *error = [NSError errorWithDomain:@"org.matrix.olm" code:0 userInfo:@{NSLocalizedDescriptionKey: @"Bad length."}]; + *error = [NSError errorWithDomain:OLMErrorDomain code:0 userInfo:@{NSLocalizedDescriptionKey: @"Bad length."}]; } return nil; } @@ -184,7 +184,7 @@ const char *olm_error = olm_account_last_error(_account); NSString *errorString = [NSString stringWithUTF8String:olm_error]; if (error && errorString) { - *error = [NSError errorWithDomain:@"org.matrix.olm" code:0 userInfo:@{NSLocalizedDescriptionKey: errorString}]; + *error = [NSError errorWithDomain:OLMErrorDomain code:0 userInfo:@{NSLocalizedDescriptionKey: errorString}]; } return nil; } @@ -201,7 +201,7 @@ const char *olm_error = olm_account_last_error(_account); NSString *errorString = [NSString stringWithUTF8String:olm_error]; if (error && errorString) { - *error = [NSError errorWithDomain:@"org.matrix.olm" code:0 userInfo:@{NSLocalizedDescriptionKey: errorString}]; + *error = [NSError errorWithDomain:OLMErrorDomain code:0 userInfo:@{NSLocalizedDescriptionKey: errorString}]; } return nil; } -- cgit v1.2.3