tk120404 / node-rssparser

🚀RSS/ATOM feed parser that returns the requested feed urls in a simple json object
http://www.laymansite.com
63 stars 20 forks source link

Duplicate callback invocation on error. #30

Open prasad83 opened 9 years ago

prasad83 commented 9 years ago

parser.addListener: end and error both trigger callback if there is trouble with xml.

parser.addListener('end', function(jsonDOM) {
    if (jsonDOM) {
        //...
        if (callback) callback(null, output);
    } else {
        if (callback) callback("failed to parse xml", null);
    }
}

parser.addListener("error", function(err) {
    // ...
    callback = null;
});
ggn06awu commented 9 years ago

+1