Permalink
Browse files

use standard error api

  • Loading branch information...
1 parent 4d6d073 commit 68ce23df93d544021fce584ad284d662ee230694 @Machx committed Apr 4, 2013
Showing with 6 additions and 4 deletions.
  1. +6 −4 Source/NSManagedObjectContextAdditions.m
@@ -84,10 +84,12 @@ -(NSUInteger)cw_countForEntity:(NSString *)entityName
error:error];
return count;
}
- CWErrorSet(kNSManagedObjectContextAdditionsDomain,
- 990,
- [NSString stringWithFormat:@"Could not find an etity of name %@",entityName],
- error);
+ if (error) {
+ *error = [NSError errorWithDomain:kNSManagedObjectContextAdditionsDomain
+ code:990 userInfo:@{
+ NSLocalizedFailureReasonErrorKey : [NSString stringWithFormat:@"Could not find an entity of name %@",entityName]
+ }];
+ }
return 0;
}

0 comments on commit 68ce23d

Please sign in to comment.