Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

There doesn't seem to be a way to retrieve response data for when a connection fails #80

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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