node-rssparser icon indicating copy to clipboard operation
node-rssparser copied to clipboard

Duplicate callback invocation on error.

Open prasad83 opened this issue 10 years ago • 1 comments

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;
});

prasad83 avatar Dec 06 '14 01:12 prasad83

+1

ggn06awu avatar Feb 27 '15 13:02 ggn06awu