 import Foundation
 
-public enum FeedParserError: Error {
+public enum FeedParserError: Error, Equatable {
     case noFeed
     case noData
     case noFeedParsed
+    case parseError
 
     var localizedDescription: String {
         switch (self) {


    public func parser(_ parser: XMLParser, parseErrorOccurred parseError: Error) {
        self.parser = nil
        self.onFailure(parseError)
    }

    private var feed : Feed? = nil

        return self
    }

    public func failure(_ failed: @escaping (FeedParserError) -> Void) -> FeedParser {
        onFailure = failed
        return self
    }
