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

Description
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.