Skip to content

Commit

Permalink
Return the appropriate status code from XHR
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewimm committed Mar 19, 2015
1 parent ca9f1e5 commit b66424e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Libraries/Network/RCTDataManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,9 @@ - (void)executeQuery:(NSString *)queryType
} else {
encoding = NSUTF8StringEncoding;
}
int responseCode = (int)[((NSHTTPURLResponse *)response) statusCode];
NSString *returnData = [[NSString alloc] initWithData:data encoding:encoding];
responseJSON = @{@"status": @200, @"responseText": returnData};
responseJSON = @{@"status": @(responseCode), @"responseText": returnData};
} else {
responseJSON = @{@"status": @0, @"responseText": [connectionError localizedDescription]};
}
Expand Down

0 comments on commit b66424e

Please sign in to comment.