Check for JSON response type before parsing

This commit is contained in:
Blake Watters
2010-10-28 16:09:40 -04:00
parent e0844d1b88
commit 66bcb412c1
2 changed files with 5 additions and 1 deletions

View File

@@ -106,7 +106,11 @@
[self release];
return YES;
} else if ([response isError]) {
[_delegate objectLoader:self didFailWithError:[_mapper parseErrorFromString:[response bodyAsString]]];
if ([response isJSON]) {
[_delegate objectLoader:self didFailWithError:[_mapper parseErrorFromString:[response bodyAsString]]];
} else {
[_delegate objectLoader:self didFailWithError:[response bodyAsString]];
}
[self release];
return YES;
}