diff options
author | rowanbeentje <rowan@beent.je> | 2009-07-09 00:10:58 +0000 |
---|---|---|
committer | rowanbeentje <rowan@beent.je> | 2009-07-09 00:10:58 +0000 |
commit | 3c85831742d01fd4dbf35b819038900018bb3a5d (patch) | |
tree | a5cbedc67d43161cb0e7e314d163abd527e89382 /Source/SPConnectionController.m | |
parent | 9818e55d8d240314fa05f76ba8b7c9ed5ba43d00 (diff) | |
download | sequelpro-3c85831742d01fd4dbf35b819038900018bb3a5d.tar.gz sequelpro-3c85831742d01fd4dbf35b819038900018bb3a5d.tar.bz2 sequelpro-3c85831742d01fd4dbf35b819038900018bb3a5d.zip |
- Fix connection controller errors with nil strings (bindings?), fixing Issue #331
- Make the "optional" socket more optional: add a list of common socket file locations that are checked (instead of just /tmp/mysql.sock), including MAMP to address a common use case
Diffstat (limited to 'Source/SPConnectionController.m')
-rw-r--r-- | Source/SPConnectionController.m | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Source/SPConnectionController.m b/Source/SPConnectionController.m index 71f075c1..b5c53aba 100644 --- a/Source/SPConnectionController.m +++ b/Source/SPConnectionController.m @@ -311,6 +311,9 @@ } else if ([mySQLConnection getLastErrorID] == 1045) { // "Access denied" error errorMessage = [NSString stringWithFormat:NSLocalizedString(@"Unable to connect to host %@ because access was denied.\n\nDouble-check your username and password and ensure that access from your current location is permitted.\n\nMySQL said: %@", @"message of panel when connection to host failed due to access denied error"), [self host], [mySQLConnection getLastErrorMessage]]; [self failConnectionWithTitle:NSLocalizedString(@"Access denied!", @"connection failed due to access denied title") errorMessage:errorMessage detail:nil]; + } else if ([self type] == SP_CONNECTION_SOCKET && (![self socket] || ![[self socket] length]) && ![mySQLConnection findSocketPath]) { + errorMessage = [NSString stringWithFormat:NSLocalizedString(@"The socket file could not be found in any common location. Please supply the correct socket location.\n\nMySQL said: %@", @"message of panel when connection to socket failed because optional socket could not be found"), [mySQLConnection getLastErrorMessage]]; + [self failConnectionWithTitle:NSLocalizedString(@"Socket not found!", @"socket not found title") errorMessage:errorMessage detail:nil]; } else { errorMessage = [NSString stringWithFormat:NSLocalizedString(@"Unable to connect to host %@, or the request timed out.\n\nBe sure that the address is correct and that you have the necessary privileges, or try increasing the connection timeout (currently %i seconds).\n\nMySQL said: %@", @"message of panel when connection to host failed"), [self host], [[prefs objectForKey:@"ConnectionTimeoutValue"] intValue], [mySQLConnection getLastErrorMessage]]; [self failConnectionWithTitle:NSLocalizedString(@"Connection failed!", @"connection failed title") errorMessage:errorMessage detail:nil]; |