Fixed: some error handling needed improving.

- Added ~/narwhal/bin to executable paths.
- Hopefully clearer error message when an executable is missing.
- Log PATH when executable is missing.
- Catch parse exceptions when parsing parser.j errors, log the returned text.
This commit is contained in:
Aparajita Fishman
2013-05-11 09:34:23 -04:00
parent 9b3676fa4f
commit 574672f15f
5 changed files with 58 additions and 28 deletions
@@ -138,19 +138,26 @@
{
notificationTitle = [(status == XCCStatusCodeError ? @"Error" : @"Warning") stringByAppendingString:@" parsing Objective-J source"];
NSArray *errors = [response propertyList];
for (NSDictionary *error in errors)
@try
{
NSMutableDictionary *info = [error mutableCopy];
info[@"projectId"] = self.projectId;
info[@"message"] = [NSString stringWithFormat:@"%@, line %d\n%@", [error[@"path"] lastPathComponent], [error[@"line"] intValue], error[@"message"]];
info[@"status"] = taskResult[@"status"];
NSArray *errors = [response propertyList];
if (self.isCancelled)
return;
[center postNotificationName:XCCConversionDidGenerateErrorNotification object:self userInfo:info];
for (NSDictionary *error in errors)
{
NSMutableDictionary *info = [error mutableCopy];
info[@"projectId"] = self.projectId;
info[@"message"] = [NSString stringWithFormat:@"%@, line %d\n%@", [error[@"path"] lastPathComponent], [error[@"line"] intValue], error[@"message"]];
info[@"status"] = taskResult[@"status"];
if (self.isCancelled)
return;
[center postNotificationName:XCCConversionDidGenerateErrorNotification object:self userInfo:info];
}
}
@catch (NSException *exception)
{
DDLogError(@"%@\n%@", exception.reason, response);
}
}