     }
     
     func parser(_ parser: XMLParser, parseErrorOccurred parseError: Error) {
-        self.parsingError = NSError(domain: parseError.localizedDescription, code: -1)
+        // Ignore errors that occur after a feed is successfully parsed. Some
+        // real-world feeds contain junk such as "[]" after the XML segment;
+        // just ignore this stuff.
+        guard !parseComplete, parsingError == nil else { return }
+        self.parsingError = NSError(domain: parseError.localizedDescription, code: -1,
+            userInfo: ["CurrentPath": currentXMLDOMPath.absoluteString])
     }
     
 }

    {
        // Update the current path along the XML's DOM elements by deleting last component.
        self.currentXMLDOMPath = self.currentXMLDOMPath.deletingLastPathComponent()
    }
    
    func parser(_ parser: XMLParser, foundCDATA CDATABlock: Data)

    
    /// A parsing error, if any.
    var parsingError: NSError?
    var parseComplete = false
    
    /// Starts parsing the feed.
    func parse() -> Result {
