JSON exception created but never raised: fix #175

In the JSON decoder an exception was created if a JSON library could not be found, however it was never raised. The exception for encoding was already being raised.
This commit is contained in:
David Keegan 2012-01-16 10:38:25 -08:00
parent d1b5e285ca
commit 391aa64392

View file

@ -143,7 +143,7 @@ static id AFJSONDecode(NSData *data, NSError **error) {
[invocation getReturnValue:&JSON]; [invocation getReturnValue:&JSON];
} 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 parsing functionality available", nil) userInfo:userInfo]; [[NSException exceptionWithName:NSInternalInconsistencyException reason:NSLocalizedString(@"No JSON parsing functionality available", nil) userInfo:userInfo] raise];
} }
return JSON; return JSON;