Suppress logging of referential integrity errors if the objectID is temporary as it likely indicates the object is not accessible from the requested context

This commit is contained in:
Blake Watters
2012-11-06 15:19:13 -05:00
parent 827945cfb3
commit 153c230751

View File

@@ -169,7 +169,8 @@
object = [context existingObjectWithID:objectID error:&error];
}];
if (! object) {
if (error) {
// Referential integrity errors often indicates that the temporary objectID does not exist in the specified context
if (error && !([objectID isTemporaryID] && [error code] == NSManagedObjectReferentialIntegrityError)) {
RKLogError(@"Failed to retrieve managed object with ID %@. Error %@\n%@", objectID, [error localizedDescription], [error userInfo]);
}