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

Callback error ignored in ping() function #177

Closed
discretepackets opened this issue Feb 4, 2017 · 1 comment
Closed

Callback error ignored in ping() function #177

discretepackets opened this issue Feb 4, 2017 · 1 comment

Comments

@discretepackets
Copy link

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.

@glynnbird glynnbird mentioned this issue Feb 6, 2017
@glynnbird
Copy link
Contributor

Thanks for reporting @discretepackets

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

No branches or pull requests

2 participants