Skip to content
This repository was archived by the owner on Mar 11, 2022. It is now read-only.
This repository was archived by the owner on Mar 11, 2022. It is now read-only.

Callback error ignored in ping() function #177

@discretepackets

Description

@discretepackets

I have added comments to this commit 6e550bb to point out parts where I think the callback errors are ignored.

I discovered this after updating to the latest version and the library fails to error out when the database is unreachable. This issue only happens for the case where the Cloudant library is passed a custom url, i.e.:

var opts = {
    url: 'http://127.0.0.1:5984'
}

var cloudant = Cloudant(opts, function(err) {
    if (err) {
        return console.log("Error connecting to CouchDB", err);
    }

    return console.log("Successfully connected to CouchDB");
});

After the changes in the referenced commit, the code above will always return "Successfully connected to CouchDB". In previous versions, the code will print an error if the host provided in opts is inaccessible or invalid.

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