aboutsummaryrefslogtreecommitdiffstats
path: root/Source/CustomQuery.m
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2010-03-25 01:13:12 +0000
committerrowanbeentje <rowan@beent.je>2010-03-25 01:13:12 +0000
commit32e858b26923b371a93e800687a13edf1254e445 (patch)
treeff2bac08381f0bd54e01c2f3f756c9fe5a2e2507 /Source/CustomQuery.m
parent5061643c1bf92a3583e4ede059951e1f17befac9 (diff)
downloadsequelpro-32e858b26923b371a93e800687a13edf1254e445.tar.gz
sequelpro-32e858b26923b371a93e800687a13edf1254e445.tar.bz2
sequelpro-32e858b26923b371a93e800687a13edf1254e445.zip
- 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
Diffstat (limited to 'Source/CustomQuery.m')
-rw-r--r--Source/CustomQuery.m8
1 files changed, 4 insertions, 4 deletions
diff --git a/Source/CustomQuery.m b/Source/CustomQuery.m
index 6fe9bf8a..b6512f5a 100644
--- a/Source/CustomQuery.m
+++ b/Source/CustomQuery.m
@@ -579,7 +579,7 @@
[streamingResult release];
// Store any error messages
- if ( ![[mySQLConnection getLastErrorMessage] isEqualToString:@""] || [mySQLConnection queryCancelled]) {
+ if ([mySQLConnection queryErrored] || [mySQLConnection queryCancelled]) {
NSString *errorString;
if ([mySQLConnection queryCancelled]) {
@@ -1672,7 +1672,7 @@
// [[NSNotificationCenter defaultCenter] postNotificationName:@"SMySQLQueryHasBeenPerformed" object:tableDocumentInstance];
// Check for errors while UPDATE
- if ( ![[mySQLConnection getLastErrorMessage] isEqualToString:@""] ) {
+ if ([mySQLConnection queryErrored]) {
SPBeginAlertSheet(NSLocalizedString(@"Error", @"error"), NSLocalizedString(@"OK", @"OK button"), NSLocalizedString(@"Cancel", @"cancel button"), nil, tableWindow, self, nil, nil, nil,
[NSString stringWithFormat:NSLocalizedString(@"Couldn't write field.\nMySQL said: %@", @"message of panel when error while updating field to db"), [mySQLConnection getLastErrorMessage]]);
@@ -1808,7 +1808,7 @@
{
queryIsTableSorter = NO;
- if(![[mySQLConnection getLastErrorMessage] isEqualToString:@""]) {
+ if ([mySQLConnection queryErrored]) {
sortColumn = nil;
return;
}
@@ -2565,7 +2565,7 @@
// search via: HELP 'searchString'
theResult = [mySQLConnection queryString:[NSString stringWithFormat:@"HELP '%@'", [searchString stringByReplacingOccurrencesOfString:@"'" withString:@"\\'"]]];
- if (![[mySQLConnection getLastErrorMessage] isEqualToString:@""])
+ if ([mySQLConnection queryErrored])
{
// if an error or HELP is not supported fall back to online search but
// don't open it if autoHelp is enabled