Error shows document URI

This commit is contained in:
relikd
2019-07-28 22:27:35 +02:00
parent d9b6641a99
commit 0331f8ca59
16 changed files with 45 additions and 44 deletions

View File

@@ -57,12 +57,12 @@
- (instancetype)initWithXMLData:(nonnull RSXMLData *)xmlData {
self = [super init];
if (self) {
_documentURI = [xmlData.urlString copy];
_documentURI = [xmlData.url copy];
_xmlInputError = [xmlData.parserError copy];
[self checkIfParserMatches:xmlData.parserClass];
_xmlData = xmlData.data;
if (!_xmlData) {
_xmlInputError = RSXMLMakeError(RSXMLErrorNoData);
_xmlInputError = RSXMLMakeError(RSXMLErrorNoData, _documentURI);
}
_parser = [[RSSAXParser alloc] initWithDelegate:self];
}
@@ -159,7 +159,7 @@
RSXMLError current = [self getExpectedErrorForClass:xmlParserClass];
RSXMLError expected = [self getExpectedErrorForClass:[self class]];
if (current != expected) {
_xmlInputError = RSXMLMakeErrorWrongParser(expected, current);
_xmlInputError = RSXMLMakeErrorWrongParser(expected, current, _documentURI);
return NO;
}
}