mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2024-12-24 00:30:51 +01:00
Make article extractor report correct state on failed Mercury parses
This commit is contained in:
parent
269b9315b2
commit
f7fd003f3c
@ -79,11 +79,12 @@ class ArticleExtractor {
|
|||||||
decoder.dateDecodingStrategy = .iso8601
|
decoder.dateDecodingStrategy = .iso8601
|
||||||
self.article = try decoder.decode(ExtractedArticle.self, from: data)
|
self.article = try decoder.decode(ExtractedArticle.self, from: data)
|
||||||
|
|
||||||
self.state = .complete
|
|
||||||
DispatchQueue.main.async {
|
DispatchQueue.main.async {
|
||||||
if self.article?.content == nil {
|
if self.article?.content == nil {
|
||||||
|
self.state = .failedToParse
|
||||||
self.delegate?.articleExtractionDidFail(with: URLError(.cannotDecodeContentData))
|
self.delegate?.articleExtractionDidFail(with: URLError(.cannotDecodeContentData))
|
||||||
} else {
|
} else {
|
||||||
|
self.state = .complete
|
||||||
self.delegate?.articleExtractionDidComplete(extractedArticle: self.article!)
|
self.delegate?.articleExtractionDidComplete(extractedArticle: self.article!)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user