         
         guard let string = String(data: CDATABlock, encoding: .utf8) else {
             self.abortParsing()
-            self.result?(Result.failure(ParserError.feedCDATABlockEncodingError(path: self.currentXMLDOMPath.absoluteString).value))
+            self.parsingError = ParserError.feedCDATABlockEncodingError(path: self.currentXMLDOMPath.absoluteString).value
             return
         }
         



extension Parser {
    
    func parserDidEndDocument(_ parser: XMLParser) {
        
        guard let feedType = self.feedType else {
            self.result?(Result.failure(ParserError.feedNotFound.value))
            return
        }
        
        switch feedType {
            
        case .Atom:
            self.result?(Result.atom(self.atomFeed!))
            
        case .RSS1, .RSS2:
            self.result?(Result.rss(self.rssFeed!))
            
        }
        
    }
    
    func parser(_ parser: XMLParser, didStartElement elementName: String, namespaceURI: String?, qualifiedName qName: String?, attributes attributeDict: [String : String]) {
        

    }
    
    func parser(_ parser: XMLParser, parseErrorOccurred parseError: Error) {
        self.parsingError = parseError as NSError
    }
    
}
