Permalink
Browse files

Print warning instead of silently ignoring the issue.

  • Loading branch information...
steipete committed Jan 6, 2014
1 parent b6aa593 commit 7e6d7738fcccfc14c1dfeea6ab1a0444b441ee98
Showing with 9 additions and 7 deletions.
  1. +9 −7 Model/GBStore.m
View
@@ -117,9 +117,10 @@ -(void)registerTypedefEnum:(GBTypedefEnumData *)typedefEnum
if ([_typedefEnums containsObject:typedefEnum]) return;
GBProtocolData *existingTypedef = [_typedefEnumsByName objectForKey:typedefEnum.nameOfEnum];
if (existingTypedef) {
- // Ignore typedef in already refined elsewhere.
- return;
- }
+ GBLogWarn(@"Ignoring typedef enum %@, already defined.", typedefEnum);
+ return;
+ }
+
[_typedefEnums addObject:typedefEnum];
[_typedefEnumsByName setObject:typedefEnum forKey:typedefEnum.nameOfEnum];
}
@@ -130,10 +131,11 @@ - (void)registerDocument:(GBDocumentData *)document {
if ([_documents containsObject:document]) return;
NSString *name = [document.nameOfDocument stringByDeletingPathExtension];
GBDocumentData *existingDocument = [_documentsByName objectForKey:name];
- if (existingDocument) {
- [NSException raise:@"Document with name %@ is already registered!", name];
- return;
- }
+ if (existingDocument) {
+ GBLogWarn(@"Ignoring document %@, already defined.", document);
+ return;
+ }
+
[_documents addObject:document];
[_documentsByName setObject:document forKey:name];
[_documentsByName setObject:document forKey:[name stringByReplacingOccurrencesOfString:@"-template" withString:@""]];

0 comments on commit 7e6d773

Please sign in to comment.