Skip to content

Commit

Permalink
actually populating errors
Browse files Browse the repository at this point in the history
  • Loading branch information
kevin-montrose committed Apr 2, 2013
1 parent 48c020e commit 74bb4f2
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 4 deletions.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "StacMan/StacManSite.m"
timestampString = "386605538.039904"
timestampString = "386605159.164095"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "58"
Expand Down
13 changes: 10 additions & 3 deletions StacMan/StacManClient.m
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,19 @@ -(StacManResponse*)enqueue:(NSString*)str ofType:(NSString*)type
[_queue addOperationWithBlock:
^()
{
NSError* error;
NSError* error = nil;
NSData* json = [NSData dataWithContentsOfURL:url options:0 error:&error];

StacManWrapper* wrapper = [[StacManWrapper alloc] initWithJson:json type:type];
if(error)
{
[ret fulfil:nil success:NO error:error];
}
else
{
StacManWrapper* wrapper = [[StacManWrapper alloc] initWithJson:json type:type];

[ret fulfil:wrapper success:YES error:nil];
[ret fulfil:wrapper success:YES error:nil];
}
}
];

Expand Down
13 changes: 13 additions & 0 deletions StacManTests/StacManTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -175,4 +175,17 @@ -(void)testGetAllUsers
}
}

-(void)testError
{
{
StacManClient* client = [[StacManClient alloc] initWithKey:@"qlH0V6SW0o3bL9n2ElNihg(("];
StacManUserMethods* users = client.users;
StacManResponse* response = [users getAllOnSite:@"stackoverflow" filter:nil page:-1 pageSize:1 fromDate:nil toDate:nil sort:@"reputation" min:nil max:nil minDate:nil maxDate:nil minName:nil maxName:nil order:nil inName:nil];

STAssertNotNil(response, @"Non nil response");

STAssertNotNil(response.error, @"Non nil error");
}
}

@end

0 comments on commit 74bb4f2

Please sign in to comment.