forked from twitter-archive/twitter-kit-ios
-
Notifications
You must be signed in to change notification settings - Fork 81
Open
Description
Expected behavior
When client.sendTwitterRequest fails due to an error from Twitter (for example 400 bad request), there needs to be a way to view the response body since it has the detailed error message from Twitter.
Actual behavior
There's no way to view the response body when request fails, the response and data object are nil, and connectionError doesn't show the error from the response body.
[client sendTwitterRequest:request completion:^(NSURLResponse *response, NSData *data, NSError *connectionError) {
if (data) {
// handle the response data e.g.
NSError *jsonError;
NSDictionary *json = [NSJSONSerialization JSONObjectWithData:data options:0 error:&jsonError];
}
else {
NSLog(@"Error: %@", connectionError);
}
}];
Steps to reproduce the behavior
Try calling a Twitter API with invalid parameters, for example https://upload.twitter.com/1.1/media/upload.json
Metadata
Metadata
Assignees
Labels
No labels