From 33b1d97e0c319960492ba33b82f06c33c8b72bd3 Mon Sep 17 00:00:00 2001 From: helge Date: Wed, 13 Jul 2005 11:24:17 +0000 Subject: [PATCH] properly detect extraction errors git-svn-id: http://svn.opengroupware.org/SOPE/trunk@892 e4a50df8-12e2-0310-a44c-efbce7f8a7e3 --- sope-gdl1/GDLContentStore/ChangeLog | 3 +++ sope-gdl1/GDLContentStore/GCSFolder.m | 22 +++++++++++++++++++++- sope-gdl1/GDLContentStore/Version | 2 +- 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/sope-gdl1/GDLContentStore/ChangeLog b/sope-gdl1/GDLContentStore/ChangeLog index e4a74484..5798d5b4 100644 --- a/sope-gdl1/GDLContentStore/ChangeLog +++ b/sope-gdl1/GDLContentStore/ChangeLog @@ -1,5 +1,8 @@ 2005-07-13 Helge Hess + * GCSFolder.m: return a proper exception if the extractor was unable to + create a quickrow for a given content object (v4.5.32) + * GCSFolder.m: added -writeContent:toName:baseVersion: to support consistent update operations (eg using etags), properly increase content object version on update operations (v4.5.31) diff --git a/sope-gdl1/GDLContentStore/GCSFolder.m b/sope-gdl1/GDLContentStore/GCSFolder.m index c912e7e8..0c5a0e18 100644 --- a/sope-gdl1/GDLContentStore/GCSFolder.m +++ b/sope-gdl1/GDLContentStore/GCSFolder.m @@ -177,6 +177,7 @@ static GCSStringFormatter *stringFormatter = nil; @"GCSExpectedVersion", [NSNumber numberWithUnsignedInt:_store], @"GCSStoredVersion", + self, @"GCSFolder", nil]; return [NSException exceptionWithName:@"GCSVersionMismatch" @@ -184,6 +185,21 @@ static GCSStringFormatter *stringFormatter = nil; userInfo:ui]; } +- (NSException *)errorExtractorReturnedNoQuickRow:(id)_extractor + forContent:(NSString *)_content +{ + NSDictionary *ui; + + ui = [NSDictionary dictionaryWithObjectsAndKeys: + self, @"GCSFolder", + _extractor, @"GCSExtractor", + _content, @"GCSContent", + nil]; + return [NSException exceptionWithName:@"GCSExtractFailed" + reason:@"Quickfield extractor did not return a result!" + userInfo:ui]; +} + /* operations */ - (NSArray *)subFolderNames { @@ -472,7 +488,11 @@ static GCSStringFormatter *stringFormatter = nil; /* extract quick info */ extractor = [self->folderInfo quickExtractor]; - quickRow = [extractor extractQuickFieldsFromContent:_content]; + if ((quickRow = [extractor extractQuickFieldsFromContent:_content]) == nil) { + return [self errorExtractorReturnedNoQuickRow:extractor + forContent:_content]; + } + [quickRow setObject:_name forKey:@"c_name"]; if (doLogStore) diff --git a/sope-gdl1/GDLContentStore/Version b/sope-gdl1/GDLContentStore/Version index d6d80e14..a0a6ec27 100644 --- a/sope-gdl1/GDLContentStore/Version +++ b/sope-gdl1/GDLContentStore/Version @@ -2,7 +2,7 @@ MAJOR_VERSION:=4 MINOR_VERSION:=5 -SUBMINOR_VERSION:=31 +SUBMINOR_VERSION:=32 # v4.5.29 requires libNGExtensions v4.5.161 # v4.5.26 does not require libNGiCal anymore -- 2.39.5