From ae9a0c3c701429a6e0cd379245a4690e1933818a Mon Sep 17 00:00:00 2001 From: Bibiko Date: Thu, 13 Jan 2011 10:51:41 +0000 Subject: =?UTF-8?q?=E2=80=A2=20improved=20error=20handling=20for=20sequelp?= =?UTF-8?q?ro=20URL=20scheme=20commands?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Source/SPAppController.m | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/Source/SPAppController.m b/Source/SPAppController.m index 7f405dba..3a381fdb 100644 --- a/Source/SPAppController.m +++ b/Source/SPAppController.m @@ -767,9 +767,30 @@ YY_BUFFER_STATE yy_scan_string (const char *); } else { SPBeginAlertSheet(NSLocalizedString(@"sequelpro URL Scheme Error", @"sequelpro url Scheme Error"), NSLocalizedString(@"OK", @"OK button"), nil, nil, [NSApp mainWindow], self, nil, nil, [NSString stringWithFormat:@"%@ “%@”:\n%@", NSLocalizedString(@"Error for", @"error for message"), [command description], NSLocalizedString(@"sequelpro URL scheme command not supported.", @"sequelpro URL scheme command not supported.")]); + + // If command failed notify the file handle hand shake mechanism + NSString *out = @"1"; + NSString *anUUID = @""; + if(command && passedProcessID && [passedProcessID length]) + anUUID = passedProcessID; + else + anUUID = command; + [out writeToFile:[NSString stringWithFormat:@"%@%@", SPURLSchemeQueryResultStatusPathHeader, anUUID] + atomically:YES + encoding:NSUTF8StringEncoding + error:nil]; + + out = @"Error"; + [out writeToFile:[NSString stringWithFormat:@"%@%@", SPURLSchemeQueryResultPathHeader, anUUID] + atomically:YES + encoding:NSUTF8StringEncoding + error:nil]; + } + return; + } if(passedProcessID && [passedProcessID length]) { -- cgit v1.2.3