diff --git a/Model/GBStore.m b/Model/GBStore.m index 50a2c408..642daafd 100644 --- a/Model/GBStore.m +++ b/Model/GBStore.m @@ -117,9 +117,10 @@ -(void)registerTypedefEnum:(GBTypedefEnumData *)typedefEnum if ([_typedefEnums containsObject:typedefEnum]) return; GBProtocolData *existingTypedef = [_typedefEnumsByName objectForKey:typedefEnum.nameOfEnum]; if (existingTypedef) { - [NSException raise:@"Typedef with name %@ is already registered!", typedefEnum.nameOfEnum]; - 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:@""]];