Skip to content

Super agent double callback bug #12

@shamblid

Description

@shamblid

In implementing the rest client I ran into this error which may be caused by this snippet of code below. I removed it from my own code and I did not run into the bug again. I am using Node 8 with async/await so I am not using callbacks in the first place.

request.end(function (error, response) {
if (callback) {
var data = null;
if (!error) {
try {
data = _this.deserialize(response, returnType);
if (_this.enableCookies && typeof window === 'undefined') {
_this.agent.saveCookies(response);
}
} catch (err) {
error = err;
}
}
callback(error, data, response);
}
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions