Commit aa12cbca authored by manuroe's avatar manuroe
Browse files

OLMKit: Make returned NSError provide the raw olm error string...

OLMKit: Make returned NSError provide the raw olm error string (ex:"UNKNOWN_MESSAGE_INDEX") in their NSLocalizedDescriptionKey.

NSLocalizedFailureReasonErrorKey can contain more contextual information.
parent 93926e90
...@@ -65,7 +65,8 @@ ...@@ -65,7 +65,8 @@
*error = [NSError errorWithDomain:OLMErrorDomain *error = [NSError errorWithDomain:OLMErrorDomain
code:0 code:0
userInfo:@{ 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 @@ ...@@ -110,7 +111,8 @@
*error = [NSError errorWithDomain:OLMErrorDomain *error = [NSError errorWithDomain:OLMErrorDomain
code:0 code:0
userInfo:@{ 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 @@ ...@@ -132,7 +134,8 @@
*error = [NSError errorWithDomain:OLMErrorDomain *error = [NSError errorWithDomain:OLMErrorDomain
code:0 code:0
userInfo:@{ userInfo:@{
NSLocalizedDescriptionKey: [NSString stringWithFormat:@"olm_group_decrypt error: %@", errorString] NSLocalizedDescriptionKey: errorString,
NSLocalizedFailureReasonErrorKey: [NSString stringWithFormat:@"olm_group_decrypt error: %@", errorString]
}]; }];
} }
......
...@@ -118,7 +118,8 @@ ...@@ -118,7 +118,8 @@
*error = [NSError errorWithDomain:OLMErrorDomain *error = [NSError errorWithDomain:OLMErrorDomain
code:0 code:0
userInfo:@{ userInfo:@{
NSLocalizedDescriptionKey: [NSString stringWithFormat:@"olm_group_encrypt error: %@", errorString] NSLocalizedDescriptionKey: errorString,
NSLocalizedFailureReasonErrorKey: [NSString stringWithFormat:@"olm_group_encrypt error: %@", errorString]
}]; }];
} }
......
...@@ -88,7 +88,8 @@ ...@@ -88,7 +88,8 @@
*error = [NSError errorWithDomain:OLMErrorDomain *error = [NSError errorWithDomain:OLMErrorDomain
code:0 code:0
userInfo:@{ userInfo:@{
NSLocalizedDescriptionKey: [NSString stringWithFormat:@"olm_create_outbound_session error: %@", errorString] NSLocalizedDescriptionKey: errorString,
NSLocalizedFailureReasonErrorKey: [NSString stringWithFormat:@"olm_create_outbound_session error: %@", errorString]
}]; }];
} }
...@@ -114,7 +115,8 @@ ...@@ -114,7 +115,8 @@
*error = [NSError errorWithDomain:OLMErrorDomain *error = [NSError errorWithDomain:OLMErrorDomain
code:0 code:0
userInfo:@{ userInfo:@{
NSLocalizedDescriptionKey: [NSString stringWithFormat:@"olm_create_inbound_session error: %@", errorString] NSLocalizedDescriptionKey: errorString,
NSLocalizedFailureReasonErrorKey: [NSString stringWithFormat:@"olm_create_inbound_session error: %@", errorString]
}]; }];
} }
...@@ -141,7 +143,8 @@ ...@@ -141,7 +143,8 @@
*error = [NSError errorWithDomain:OLMErrorDomain *error = [NSError errorWithDomain:OLMErrorDomain
code:0 code:0
userInfo:@{ userInfo:@{
NSLocalizedDescriptionKey: [NSString stringWithFormat:@"olm_create_inbound_session_from error: %@", errorString] NSLocalizedDescriptionKey: errorString,
NSLocalizedFailureReasonErrorKey: [NSString stringWithFormat:@"olm_create_inbound_session_from error: %@", errorString]
}]; }];
} }
...@@ -222,7 +225,8 @@ ...@@ -222,7 +225,8 @@
*error = [NSError errorWithDomain:OLMErrorDomain *error = [NSError errorWithDomain:OLMErrorDomain
code:0 code:0
userInfo:@{ userInfo:@{
NSLocalizedDescriptionKey: [NSString stringWithFormat:@"olm_encrypt error: %@", errorString] NSLocalizedDescriptionKey: errorString,
NSLocalizedFailureReasonErrorKey: [NSString stringWithFormat:@"olm_encrypt error: %@", errorString]
}]; }];
} }
...@@ -251,7 +255,8 @@ ...@@ -251,7 +255,8 @@
*error = [NSError errorWithDomain:OLMErrorDomain *error = [NSError errorWithDomain:OLMErrorDomain
code:0 code:0
userInfo:@{ userInfo:@{
NSLocalizedDescriptionKey: [NSString stringWithFormat:@"olm_decrypt_max_plaintext_length error: %@", errorString] NSLocalizedDescriptionKey: errorString,
NSLocalizedFailureReasonErrorKey: [NSString stringWithFormat:@"olm_decrypt_max_plaintext_length error: %@", errorString]
}]; }];
} }
...@@ -271,7 +276,8 @@ ...@@ -271,7 +276,8 @@
*error = [NSError errorWithDomain:OLMErrorDomain *error = [NSError errorWithDomain:OLMErrorDomain
code:0 code:0
userInfo:@{ userInfo:@{
NSLocalizedDescriptionKey: [NSString stringWithFormat:@"olm_decrypt error: %@", errorString] NSLocalizedDescriptionKey: errorString,
NSLocalizedFailureReasonErrorKey: [NSString stringWithFormat:@"olm_decrypt error: %@", errorString]
}]; }];
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment