NodeJs SDK 3.1 "cluster Object Closed"

I am wondering if it is expected to get a

Error: cluster object was closed

message if one try’s to connect to a bucket that does not exist or misspelled ? I would say if one try’s to connect something that doesn’t exist or is misspelled , the SDK could provide a bit more info why the cluster object closed.

another thing which seems to be strange, if i go and try to get a doc which does not exist in my bucket i get an error cause code of 301

  cause: LibcouchbaseError { code: 301 },
  context: KeyValueErrorContext {
    status_code: 1,
    opaque: 7,
    cas: CbCas { '0': <Buffer 00 00 00 00 00 00 00 00> },
    key: 'cname::1234567',
    bucket: 'CONTACTS',
    collection: '_default',
    scope: '_default',
    context: '',
    ref: ''

i can catch the error via

error instanceof couchbase.DocumentNotFoundError

But looking at the SDK error codes 301 does not make sense

Analytics Error Definitions

ID Range 300 - 399

# 301 CompilationFailure

Raised when error range 24xxx (excluded are specific codes in the errors below).

So where can i find a list of all valid correct cause codes and is there a list what errors i can catch via instance of…

1 Like

I’m in the same boat. How are we supposed to even validate a connection string? Seems like there’s exactly NO WAY to do it. The only way I’ve seen to verify a connection is to attempt to actually read or write to a bucket, then catch the completely useless ‘cluster object was closed’ error message, then infer that the error was likely caused by a connection string problem. I truly hope this isn’t the case.

1 Like