Skip to content

Commit

Permalink
Explicitly return an error when waitForTicket: exits its loop without…
Browse files Browse the repository at this point in the history
… the callback having been invoked

git-svn-id: http://gdata-objectivec-client.googlecode.com/svn/trunk@715 f334b912-182a-0410-b59a-f50d4d03ee1a
  • Loading branch information
gregrobbins@gmail.com committed Dec 27, 2011
1 parent 2092519 commit 56ea3ea
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions Source/BaseClasses/GDataServiceBase.h
Expand Up @@ -60,6 +60,7 @@ _EXTERN NSString* const kGDataServiceTicketParsingStoppedNotification _INITIALIZ

enum {
kGDataCouldNotConstructObjectError = -100,
kGDataWaitTimedOutError = -101
};

@class GDataServiceTicketBase;
Expand Down
6 changes: 6 additions & 0 deletions Source/BaseClasses/GDataServiceBase.m
Expand Up @@ -1307,6 +1307,12 @@ - (BOOL)waitForTicket:(GDataServiceTicketBase *)ticket

NSError *fetchError = [ticket fetchError];

if (![ticket hasCalledCallback] && fetchError == nil) {
fetchError = [NSError errorWithDomain:kGDataServiceErrorDomain
code:kGDataWaitTimedOutError
userInfo:nil];
}

if (outObjectOrNil) *outObjectOrNil = [ticket fetchedObject];
if (outErrorOrNil) *outErrorOrNil = fetchError;

Expand Down

0 comments on commit 56ea3ea

Please sign in to comment.