mirror of
https://github.com/zhigang1992/UICKeyChainStore.git
synced 2026-01-12 22:53:17 +08:00
Merge pull request #74 from sirnacnud/error
Made securityError more descriptive for OS X
This commit is contained in:
@@ -1253,7 +1253,14 @@ static NSString *_defaultService;
|
||||
|
||||
+ (NSError *)securityError:(OSStatus)status
|
||||
{
|
||||
NSError *error = [NSError errorWithDomain:UICKeyChainStoreErrorDomain code:status userInfo:@{NSLocalizedDescriptionKey: @"Security error has occurred."}];
|
||||
NSString *message = @"Security error has occurred.";
|
||||
#if !TARGET_OS_IPHONE
|
||||
CFStringRef description = SecCopyErrorMessageString(status, NULL);
|
||||
if (description) {
|
||||
message = (__bridge_transfer NSString *)description;
|
||||
}
|
||||
#endif
|
||||
NSError *error = [NSError errorWithDomain:UICKeyChainStoreErrorDomain code:status userInfo:@{NSLocalizedDescriptionKey: message}];
|
||||
NSLog(@"OSStatus error: [%@] %@", @(error.code), error.localizedDescription);
|
||||
return error;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user