Merge pull request #121 from aaronbrethorst/master

Raise an exception if JSON generation capability doesn't exist
This commit is contained in:
Mattt Thompson 2011-11-21 15:07:39 -08:00
commit c1bc698682

View file

@ -82,7 +82,7 @@ static NSData * AFJSONEncode(id object, NSError **error) {
[invocation getReturnValue:&data]; [invocation getReturnValue:&data];
} else { } else {
NSDictionary *userInfo = [NSDictionary dictionaryWithObject:NSLocalizedString(@"Please either target a platform that supports NSJSONSerialization or add one of the following libraries to your project: JSONKit, SBJSON, or YAJL", nil) forKey:NSLocalizedRecoverySuggestionErrorKey]; NSDictionary *userInfo = [NSDictionary dictionaryWithObject:NSLocalizedString(@"Please either target a platform that supports NSJSONSerialization or add one of the following libraries to your project: JSONKit, SBJSON, or YAJL", nil) forKey:NSLocalizedRecoverySuggestionErrorKey];
[NSException exceptionWithName:NSInternalInconsistencyException reason:NSLocalizedString(@"No JSON generation functionality available", nil) userInfo:userInfo]; [[NSException exceptionWithName:NSInternalInconsistencyException reason:NSLocalizedString(@"No JSON generation functionality available", nil) userInfo:userInfo] raise];
} }
return data; return data;