Skip to content

Conversation

kangaroo5383
Copy link

In the app that I'm developing, on connection fail I need a way to access the response data to know what error message to display.

This is my addition to the library to bypass the issue. Alternatively if there exist a way to do so in the current version, would be great if you can point me in the right direction. Appreciate it!

gkoehler pushed a commit to gkoehler/OAuth2Client that referenced this pull request Feb 14, 2014
@@ -499,6 +499,12 @@ - (void)oauthConnection:(NXOAuth2Connection *)connection didFailWithError:(NSErr
NSString *body = [[NSString alloc] initWithData:connection.data encoding:NSUTF8StringEncoding];
NSLog(@"oauthConnection Error: %@", body);

NSMutableDictionary *userInfo = [NSMutableDictionary dictionaryWithDictionary:error.userInfo];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case you should reference the old error in the userInfo with NSUnderlyingErrorKey.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants