diff --git a/AFNetworking/AFJSONRequestOperation.m b/AFNetworking/AFJSONRequestOperation.m index a4e56d2..16d1465 100644 --- a/AFNetworking/AFJSONRequestOperation.m +++ b/AFNetworking/AFJSONRequestOperation.m @@ -37,7 +37,7 @@ static dispatch_queue_t json_request_operation_processing_queue() { @interface AFJSONRequestOperation () @property (readwrite, nonatomic, retain) id responseJSON; -@property (readwrite, nonatomic, retain) NSError *error; +@property (readwrite, nonatomic, retain) NSError *JSONError; + (NSSet *)defaultAcceptableContentTypes; + (NSSet *)defaultAcceptablePathExtensions; @@ -45,7 +45,7 @@ static dispatch_queue_t json_request_operation_processing_queue() { @implementation AFJSONRequestOperation @synthesize responseJSON = _responseJSON; -@synthesize error = _JSONError; +@synthesize JSONError = _JSONError; + (AFJSONRequestOperation *)JSONRequestOperationWithRequest:(NSURLRequest *)urlRequest success:(void (^)(NSURLRequest *request, NSHTTPURLResponse *response, id JSON))success @@ -129,12 +129,20 @@ static dispatch_queue_t json_request_operation_processing_queue() { #endif } - self.error = error; + self.JSONError = error; } return _responseJSON; } +- (NSError *)error { + if (_JSONError) { + return _JSONError; + } else { + return [super error]; + } +} + #pragma mark - AFHTTPClientOperation + (BOOL)canProcessRequest:(NSURLRequest *)request {