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/SPTableTriggers.m | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'Source/SPTableTriggers.m') diff --git a/Source/SPTableTriggers.m b/Source/SPTableTriggers.m index 78c9ba52..6e8d6873 100644 --- a/Source/SPTableTriggers.m +++ b/Source/SPTableTriggers.m @@ -128,10 +128,7 @@ // Execute query [connection queryString:query]; - NSInteger retCode = (![[connection getLastErrorMessage] isEqualToString:@""]); - - // Zero indicates success - if (retCode) { + if (([connection queryErrored])) { SPBeginAlertSheet(NSLocalizedString(@"Error creating trigger", @"error creating trigger message"), NSLocalizedString(@"OK", @"OK button"), nil, nil, [NSApp mainWindow], nil, nil, nil, nil, @@ -320,7 +317,7 @@ [connection queryString:query]; - if (![[connection getLastErrorMessage] isEqualToString:@""] ) { + if ([connection queryErrored]) { SPBeginAlertSheet(NSLocalizedString(@"Unable to remove trigger", @"error removing trigger message"), NSLocalizedString(@"OK", @"OK button"), -- cgit v1.2.3