mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 00:30:53 +00:00
Improve error logging.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@14367 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
66589988d3
commit
c927b22e52
2 changed files with 38 additions and 28 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2002-08-29 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
|
* Source/Additions/GSXML.m: Get libxml to put filename in error
|
||||||
|
messages when it is available.
|
||||||
|
|
||||||
2002-08-28 Richard Frith-Macdonald <rfm@gnu.org>
|
2002-08-28 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
* Source/Unicode.m: Rewritten the way that iconv is used to decide
|
* Source/Unicode.m: Rewritten the way that iconv is used to decide
|
||||||
|
|
|
@ -1665,17 +1665,14 @@ static NSString *endMarker = @"At end of incremental parse";
|
||||||
- (id) initWithSAXHandler: (GSSAXHandler*)handler
|
- (id) initWithSAXHandler: (GSSAXHandler*)handler
|
||||||
withContentsOfFile: (NSString*)path
|
withContentsOfFile: (NSString*)path
|
||||||
{
|
{
|
||||||
self = [self initWithSAXHandler: handler];
|
if (path == nil || [path isKindOfClass: [NSString class]] == NO)
|
||||||
if (self != nil)
|
|
||||||
{
|
{
|
||||||
if (path == nil || [path isKindOfClass: [NSString class]] == NO)
|
NSLog(@"Bad file path passed to initialize GSXMLParser");
|
||||||
{
|
RELEASE(self);
|
||||||
NSLog(@"Bad file path passed to initialize GSXMLParser");
|
return nil;
|
||||||
RELEASE(self);
|
|
||||||
return nil;
|
|
||||||
}
|
|
||||||
src = [path copy];
|
|
||||||
}
|
}
|
||||||
|
src = [path copy];
|
||||||
|
self = [self initWithSAXHandler: handler];
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1693,17 +1690,14 @@ static NSString *endMarker = @"At end of incremental parse";
|
||||||
- (id) initWithSAXHandler: (GSSAXHandler*)handler
|
- (id) initWithSAXHandler: (GSSAXHandler*)handler
|
||||||
withContentsOfURL: (NSURL*)url
|
withContentsOfURL: (NSURL*)url
|
||||||
{
|
{
|
||||||
self = [self initWithSAXHandler: handler];
|
if (url == nil || [url isKindOfClass: [NSURL class]] == NO)
|
||||||
if (self != nil)
|
|
||||||
{
|
{
|
||||||
if (url == nil || [url isKindOfClass: [NSURL class]] == NO)
|
NSLog(@"Bad NSURL passed to initialize GSXMLParser");
|
||||||
{
|
RELEASE(self);
|
||||||
NSLog(@"Bad NSURL passed to initialize GSXMLParser");
|
return nil;
|
||||||
RELEASE(self);
|
|
||||||
return nil;
|
|
||||||
}
|
|
||||||
src = [url copy];
|
|
||||||
}
|
}
|
||||||
|
src = [url copy];
|
||||||
|
self = [self initWithSAXHandler: handler];
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1721,17 +1715,14 @@ static NSString *endMarker = @"At end of incremental parse";
|
||||||
- (id) initWithSAXHandler: (GSSAXHandler*)handler
|
- (id) initWithSAXHandler: (GSSAXHandler*)handler
|
||||||
withData: (NSData*)data
|
withData: (NSData*)data
|
||||||
{
|
{
|
||||||
self = [self initWithSAXHandler: handler];
|
if (data == nil || [data isKindOfClass: [NSData class]] == NO)
|
||||||
if (self != nil)
|
|
||||||
{
|
{
|
||||||
if (data == nil || [data isKindOfClass: [NSData class]] == NO)
|
NSLog(@"Bad NSData passed to initialize GSXMLParser");
|
||||||
{
|
RELEASE(self);
|
||||||
NSLog(@"Bad NSData passed to initialize GSXMLParser");
|
return nil;
|
||||||
RELEASE(self);
|
|
||||||
return nil;
|
|
||||||
}
|
|
||||||
src = [data copy];
|
|
||||||
}
|
}
|
||||||
|
src = [data copy];
|
||||||
|
self = [self initWithSAXHandler: handler];
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1910,7 +1901,21 @@ static NSString *endMarker = @"At end of incremental parse";
|
||||||
|
|
||||||
- (BOOL) _initLibXML
|
- (BOOL) _initLibXML
|
||||||
{
|
{
|
||||||
lib = (void*)xmlCreatePushParserCtxt([saxHandler lib], NULL, 0, 0, ".");
|
const char *file;
|
||||||
|
|
||||||
|
if ([src isKindOfClass: [NSString class]])
|
||||||
|
{
|
||||||
|
file = [src lossyCString];
|
||||||
|
}
|
||||||
|
else if ([src isKindOfClass: [NSURL class]])
|
||||||
|
{
|
||||||
|
file = [[src absoluteString] lossyCString];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
file = ".";
|
||||||
|
}
|
||||||
|
lib = (void*)xmlCreatePushParserCtxt([saxHandler lib], NULL, 0, 0, file);
|
||||||
if (lib == NULL)
|
if (lib == NULL)
|
||||||
{
|
{
|
||||||
NSLog(@"Failed to create libxml parser context");
|
NSLog(@"Failed to create libxml parser context");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue