I don’t understand how to properly make AND VERIFY a connection to a Couchbase cluster.
Am I correct in assuming that literally the ONLY way to even verify a cluster connection is to actually attempt to read data from a bucket?
If I’m wrong, how does one confirm a bad connection string?
const cb = require('couchbase')
const cluster = new cb.Cluster('couchbase://localhost', {
username: 'goodusername',
password: 'badpassword'
})
//connect to bucket, but no error callback and no promise?
cluster.bucket('mybucket')
//is this really the way?
try {
await cluster.query(`SELECT * FROM mybucket WHERE meta().id = 'x'`)
} catch (err) {
//The SDK appears to simply return a useless error message Error: cluster object was closed.
console.error(`Error connecting to Couchbase: ${err}. No idea what you should do now.`)
process.exit(1)
}