From aa12cbcac2d9f380847644febdf1f13f102cebb1 Mon Sep 17 00:00:00 2001 From: manuroe Date: Thu, 24 Nov 2016 11:45:59 +0100 Subject: OLMKit: Make returned NSError provide the raw olm error string (ex:"UNKNOWN_MESSAGE_INDEX") in their NSLocalizedDescriptionKey. NSLocalizedFailureReasonErrorKey can contain more contextual information. --- xcode/OLMKit/OLMInboundGroupSession.m | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'xcode/OLMKit/OLMInboundGroupSession.m') diff --git a/xcode/OLMKit/OLMInboundGroupSession.m b/xcode/OLMKit/OLMInboundGroupSession.m index eec2ffa..4f7bdd7 100644 --- a/xcode/OLMKit/OLMInboundGroupSession.m +++ b/xcode/OLMKit/OLMInboundGroupSession.m @@ -65,7 +65,8 @@ *error = [NSError errorWithDomain:OLMErrorDomain code:0 userInfo:@{ - NSLocalizedDescriptionKey: [NSString stringWithFormat:@"olm_init_inbound_group_session error: %@", errorString] + NSLocalizedDescriptionKey: errorString, + NSLocalizedFailureReasonErrorKey: [NSString stringWithFormat:@"olm_init_inbound_group_session error: %@", errorString] }]; } @@ -110,7 +111,8 @@ *error = [NSError errorWithDomain:OLMErrorDomain code:0 userInfo:@{ - NSLocalizedDescriptionKey: [NSString stringWithFormat:@"olm_group_decrypt_max_plaintext_length error: %@", errorString] + NSLocalizedDescriptionKey: errorString, + NSLocalizedFailureReasonErrorKey: [NSString stringWithFormat:@"olm_group_decrypt_max_plaintext_length error: %@", errorString] }]; } @@ -132,7 +134,8 @@ *error = [NSError errorWithDomain:OLMErrorDomain code:0 userInfo:@{ - NSLocalizedDescriptionKey: [NSString stringWithFormat:@"olm_group_decrypt error: %@", errorString] + NSLocalizedDescriptionKey: errorString, + NSLocalizedFailureReasonErrorKey: [NSString stringWithFormat:@"olm_group_decrypt error: %@", errorString] }]; } -- cgit v1.2.3