From: znek Date: Sat, 8 Apr 2006 02:19:26 +0000 (+0000) Subject: improved error reporting X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1bebacede3e29361a00692a9729900f057d66169;p=sope improved error reporting git-svn-id: http://svn.opengroupware.org/SOPE/trunk@1247 e4a50df8-12e2-0310-a44c-efbce7f8a7e3 --- diff --git a/sope-ical/versitSaxDriver/ChangeLog b/sope-ical/versitSaxDriver/ChangeLog index 0b0dd0ea..c6700d6f 100644 --- a/sope-ical/versitSaxDriver/ChangeLog +++ b/sope-ical/versitSaxDriver/ChangeLog @@ -1,3 +1,8 @@ +2006-04-08 Marcus Mueller + + * VSSaxDriver.m: improved error reporting in case no data could be + retrieved from a URL (v4.5.22) + 2005-12-05 Helge Hess * v4.5.21 diff --git a/sope-ical/versitSaxDriver/VSSaxDriver.m b/sope-ical/versitSaxDriver/VSSaxDriver.m index 5013ea92..df94370f 100644 --- a/sope-ical/versitSaxDriver/VSSaxDriver.m +++ b/sope-ical/versitSaxDriver/VSSaxDriver.m @@ -1016,15 +1016,32 @@ static VSStringFormatter *stringFormatter = nil; NSLog(@"%s: parse: %@ (sysid=%@)", __PRETTY_FUNCTION__, _source, _sysId); if ([_source isKindOfClass:[NSURL class]]) { - if (_sysId == nil) _sysId = [_source absoluteString]; + NSURL *url; + + url = _source; + if (_sysId == nil) _sysId = [url absoluteString]; if (debugOn) { NSLog(@"%s: trying to load URL: %@ (sysid=%@)",__PRETTY_FUNCTION__, - _source, _sysId); + url, _sysId); } // TODO: remember encoding of source - _source = [_source resourceDataUsingCache:NO]; + _source = [url resourceDataUsingCache:NO]; + if (_source == nil || ![_source length]) { + SaxParseException *e; + NSString *s; + + if (debugOn) + NSLog(@"%s: got no data from url: %@", __PRETTY_FUNCTION__, url); + + s = [NSString stringWithFormat:@"got no data from url: %@", url]; + e = (id)[SaxParseException exceptionWithName:@"SaxIOException" + reason:s + userInfo:nil]; + [self->errorHandler fatalError:e]; + return; + } } if ([_source isKindOfClass:[NSData class]]) { diff --git a/sope-ical/versitSaxDriver/Version b/sope-ical/versitSaxDriver/Version index c4b3e0d5..021f6fc6 100644 --- a/sope-ical/versitSaxDriver/Version +++ b/sope-ical/versitSaxDriver/Version @@ -1,3 +1,3 @@ # Version file -SUBMINOR_VERSION:=21 +SUBMINOR_VERSION:=22