Skip to content
Browse files

Use new request method passing error pointer instead of failure block.

  • Loading branch information...
1 parent 2682e79 commit fef7bf3fb1ac729118c276d02cba9ff97c49a2c0 Owain R Hunt committed Apr 13, 2012
Showing with 4 additions and 7 deletions.
  1. +4 −7 UAGithubEngine/UAGithubEngine.m
View
11 UAGithubEngine/UAGithubEngine.m
@@ -239,7 +239,7 @@ - (id)sendRequest:(NSString *)path requestType:(UAGithubRequestType)requestType
}
__block NSError *blockError = nil;
-
+
id returnValue = [UAGithubURLConnection asyncRequest:urlRequest
success:^(NSData *data, NSURLResponse *response)
{
@@ -248,7 +248,8 @@ - (id)sendRequest:(NSString *)path requestType:(UAGithubRequestType)requestType
if ([[[resp allHeaderFields] allKeys] containsObject:@"X-Ratelimit-Remaining"] && [[[resp allHeaderFields] valueForKey:@"X-Ratelimit-Remaining"] isEqualToString:@"1"])
- {
+ {
+ blockError = [NSError errorWithDomain:UAGithubAPILimitReached code:statusCode userInfo:[NSDictionary dictionaryWithObject:urlRequest forKey:@"request"]];
return [NSError errorWithDomain:UAGithubAPILimitReached code:statusCode userInfo:[NSDictionary dictionaryWithObject:urlRequest forKey:@"request"]];
}
@@ -287,11 +288,7 @@ - (id)sendRequest:(NSString *)path requestType:(UAGithubRequestType)requestType
}
}
- failure:^(NSError *parserError)
- {
- return parserError;
- }
- ];
+ error:&blockError];
if (blockError)
{

0 comments on commit fef7bf3

Please sign in to comment.
Something went wrong with that request. Please try again.