From 2b4af74516353df1a8e4db256a2b3e58f319ed94 Mon Sep 17 00:00:00 2001 From: stuconnolly Date: Fri, 21 Aug 2009 18:31:37 +0000 Subject: When an error occurs whilst trying to add a password to the Keychain present a dialog to user, suggesting the repair their Keychain or contact us if the problem persists. --- Source/SPKeychain.m | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Source/SPKeychain.m b/Source/SPKeychain.m index 0929317d..5e98eb26 100644 --- a/Source/SPKeychain.m +++ b/Source/SPKeychain.m @@ -97,8 +97,14 @@ NULL); // The item reference if (passwordAccessRef) CFRelease(passwordAccessRef); + if (status != noErr) { NSLog(@"Error (%i) while trying to add password for name: %@ account: %@", status, name, account); + + NSBeginAlertSheet(NSLocalizedString(@"Error adding password to Keychain", @"error adding password to keychain message"), + NSLocalizedString(@"OK", @"OK button"), + nil, nil, [NSApp mainWindow], self, nil, nil, nil, + [NSString stringWithFormat:NSLocalizedString(@"An error occured while trying to add the password to your Keychain. Repairing your Keychain might resolve this, but if it doesn't please report it to the Sequel Pro team, supplying the error code %i.", @"error adding password to keychain informative message"), status]); } } } -- cgit v1.2.3