Raise an exception when JSON generation functionality doesn't exist.

This commit is contained in:
Aaron Brethorst 2011-11-21 11:57:04 -08:00
parent 1f750a36fe
commit ac811fc5ec

View file

@ -82,7 +82,7 @@ static NSData * AFJSONEncode(id object, NSError **error) {
[invocation getReturnValue:&data];
} 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];
[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;