From: helge Date: Thu, 4 Aug 2005 21:47:59 +0000 (+0000) Subject: improved logs for decoding errors X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c0fef4dccd1a81db7796806e024e1ba7d4e51e20;p=sope improved logs for decoding errors git-svn-id: http://svn.opengroupware.org/SOPE/trunk@973 e4a50df8-12e2-0310-a44c-efbce7f8a7e3 --- diff --git a/sope-core/EOControl/ChangeLog b/sope-core/EOControl/ChangeLog index 8b94d3a0..8039c15c 100644 --- a/sope-core/EOControl/ChangeLog +++ b/sope-core/EOControl/ChangeLog @@ -1,3 +1,8 @@ +2005-08-04 Helge Hess + + * EOKeyValueArchiver.m: print a warning if a class specified in the + archive could not be found (v4.5.56) + 2005-08-04 Helge Hess * v4.5.55 diff --git a/sope-core/EOControl/EOKeyValueArchiver.m b/sope-core/EOControl/EOKeyValueArchiver.m index 6ef7cb28..f2eabf52 100644 --- a/sope-core/EOControl/EOKeyValueArchiver.m +++ b/sope-core/EOControl/EOKeyValueArchiver.m @@ -195,16 +195,27 @@ static BOOL isPListObject(id _obj) { obj = [[self->plist copy] autorelease]; } else if ((className = [self->plist objectForKey:@"class"]) != nil) { - obj = [[self classForName:className] alloc]; - obj = [obj initWithKeyValueUnarchiver:self]; + Class clazz; + + if ((clazz = [self classForName:className]) != nil) { + obj = [clazz alloc]; + obj = [obj initWithKeyValueUnarchiver:self]; - if (obj != nil) - [self->unarchivedObjects addObject:obj]; + if (obj != nil) + [self->unarchivedObjects addObject:obj]; + else { + NSLog(@"WARNING(%s): could not unarchive object %@", + __PRETTY_FUNCTION__, self->plist); + } + if (self->unarchivedObjects != nil) + [obj release]; + else + [obj autorelease]; + } else { - NSLog(@"WARNING(%s): could not unarchive object %@", - __PRETTY_FUNCTION__, self->plist); + NSLog(@"WARNING(%s): did not find class specified in archive '%@': %@", + __PRETTY_FUNCTION__, className, self->plist); } - [obj release]; } else { obj = nil; diff --git a/sope-core/EOControl/Version b/sope-core/EOControl/Version index 1e1b1b4f..0d71e766 100644 --- a/sope-core/EOControl/Version +++ b/sope-core/EOControl/Version @@ -1,3 +1,3 @@ # version file -SUBMINOR_VERSION:=55 +SUBMINOR_VERSION:=56