From 32e858b26923b371a93e800687a13edf1254e445 Mon Sep 17 00:00:00 2001 From: rowanbeentje Date: Thu, 25 Mar 2010 01:13:12 +0000 Subject: - Make [MCPConnection getLastErrorMessage] more consistent by always returning nil if no error occurred (previously a blank string was returned most of the time) - Add a new (BOOL)[MCPConnection queryErrored] method, changing all error message checks to use it for clarity --- Source/SPProcessListController.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Source/SPProcessListController.m') diff --git a/Source/SPProcessListController.m b/Source/SPProcessListController.m index ab0ae931..d655e776 100644 --- a/Source/SPProcessListController.m +++ b/Source/SPProcessListController.m @@ -449,7 +449,7 @@ [connection queryString:[NSString stringWithFormat:@"KILL QUERY %lu", (unsigned long)processId]]; // Check for errors - if (![[connection getLastErrorMessage] isEqualToString:@""]) { + if ([connection queryErrored]) { SPBeginAlertSheet(NSLocalizedString(@"Unable to kill query", @"error killing query message"), NSLocalizedString(@"OK", @"OK button"), nil, nil, [self window], self, nil, nil, nil, [NSString stringWithFormat:NSLocalizedString(@"An error occured while attempting to kill the query associated with connection %lu.\n\nMySQL said: %@", @"error killing query informative message"), (unsigned long)processId, [connection getLastErrorMessage]]); } @@ -467,7 +467,7 @@ [connection queryString:[NSString stringWithFormat:@"KILL CONNECTION %lu", (unsigned long)processId]]; // Check for errors - if (![[connection getLastErrorMessage] isEqualToString:@""]) { + if ([connection queryErrored]) { SPBeginAlertSheet(NSLocalizedString(@"Unable to kill connection", @"error killing connection message"), NSLocalizedString(@"OK", @"OK button"), nil, nil, [self window], self, nil, nil, nil, [NSString stringWithFormat:NSLocalizedString(@"An error occured while attempting to kill connection %lu.\n\nMySQL said: %@", @"error killing query informative message"), (unsigned long)processId, [connection getLastErrorMessage]]); } -- cgit v1.2.3