|
@@ -129,12 +129,14 @@ static NSString * AFStringFromIndexSet(NSIndexSet *indexSet) {
|
|
if (![self hasAcceptableStatusCode]) {
|
|
if (![self hasAcceptableStatusCode]) {
|
|
NSMutableDictionary *userInfo = [NSMutableDictionary dictionary];
|
|
NSMutableDictionary *userInfo = [NSMutableDictionary dictionary];
|
|
[userInfo setValue:[NSString stringWithFormat:NSLocalizedString(@"Expected status code in (%@), got %d", nil), AFStringFromIndexSet([[self class] acceptableStatusCodes]), [self.response statusCode]] forKey:NSLocalizedDescriptionKey];
|
|
[userInfo setValue:[NSString stringWithFormat:NSLocalizedString(@"Expected status code in (%@), got %d", nil), AFStringFromIndexSet([[self class] acceptableStatusCodes]), [self.response statusCode]] forKey:NSLocalizedDescriptionKey];
|
|
|
|
+ [userInfo setValue:self.responseString forKey:NSLocalizedRecoverySuggestionErrorKey];
|
|
[userInfo setValue:[self.request URL] forKey:NSURLErrorFailingURLErrorKey];
|
|
[userInfo setValue:[self.request URL] forKey:NSURLErrorFailingURLErrorKey];
|
|
|
|
|
|
self.HTTPError = [[[NSError alloc] initWithDomain:AFNetworkingErrorDomain code:NSURLErrorBadServerResponse userInfo:userInfo] autorelease];
|
|
self.HTTPError = [[[NSError alloc] initWithDomain:AFNetworkingErrorDomain code:NSURLErrorBadServerResponse userInfo:userInfo] autorelease];
|
|
} else if ([self.responseData length] > 0 && ![self hasAcceptableContentType]) { // Don't invalidate content type if there is no content
|
|
} else if ([self.responseData length] > 0 && ![self hasAcceptableContentType]) { // Don't invalidate content type if there is no content
|
|
NSMutableDictionary *userInfo = [NSMutableDictionary dictionary];
|
|
NSMutableDictionary *userInfo = [NSMutableDictionary dictionary];
|
|
[userInfo setValue:[NSString stringWithFormat:NSLocalizedString(@"Expected content type %@, got %@", nil), [[self class] acceptableContentTypes], [self.response MIMEType]] forKey:NSLocalizedDescriptionKey];
|
|
[userInfo setValue:[NSString stringWithFormat:NSLocalizedString(@"Expected content type %@, got %@", nil), [[self class] acceptableContentTypes], [self.response MIMEType]] forKey:NSLocalizedDescriptionKey];
|
|
|
|
+ [userInfo setValue:self.responseString forKey:NSLocalizedRecoverySuggestionErrorKey];
|
|
[userInfo setValue:[self.request URL] forKey:NSURLErrorFailingURLErrorKey];
|
|
[userInfo setValue:[self.request URL] forKey:NSURLErrorFailingURLErrorKey];
|
|
|
|
|
|
self.HTTPError = [[[NSError alloc] initWithDomain:AFNetworkingErrorDomain code:NSURLErrorCannotDecodeContentData userInfo:userInfo] autorelease];
|
|
self.HTTPError = [[[NSError alloc] initWithDomain:AFNetworkingErrorDomain code:NSURLErrorCannotDecodeContentData userInfo:userInfo] autorelease];
|