Skip to content

Commit

Permalink
GH-80 Add temporary core data fetch error indication
Browse files Browse the repository at this point in the history
  • Loading branch information
Dima Zen committed May 9, 2017
1 parent 030fd2b commit dd8292f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion FastEasyMapping/Source/Cache/FEMObjectCache.m
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,15 @@ - (instancetype)initWithContext:(NSManagedObjectContext *)context
[fetchRequest setPredicate:predicate];
[fetchRequest setFetchLimit:primaryKeys.count];

NSArray *existingObjects = [context executeFetchRequest:fetchRequest error:NULL];
NSError *error = nil;
NSArray *existingObjects = [context executeFetchRequest:fetchRequest error:&error];

// TODO: Errors handling needed. This is a temprorary solution to at least indicate critical situation
// rather than pollute database with duplicates
if (error != nil) {
@throw [NSException exceptionWithName:NSInternalInconsistencyException reason:[error debugDescription] userInfo:nil];
}

return existingObjects;
}

Expand Down

0 comments on commit dd8292f

Please sign in to comment.