Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicate callback invocation on error. #30

Open
prasad83 opened this issue Dec 6, 2014 · 1 comment
Open

Duplicate callback invocation on error. #30

prasad83 opened this issue Dec 6, 2014 · 1 comment

Comments

@prasad83
Copy link

prasad83 commented Dec 6, 2014

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
Copy link

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants