+2006-04-08 Marcus Mueller <znek@mulle-kybernetik.com>
+
+ * VSSaxDriver.m: improved error reporting in case no data could be
+ retrieved from a URL (v4.5.22)
+
2005-12-05 Helge Hess <helge.hess@skyrix.com>
* v4.5.21
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]]) {