I have the following code that creates Couchbase cluster and tried to open a bucket. The name given to the bucket is a wrong name. I want to capture the error since the bucket does not exist. Using java client version 2.7.6 and Java 11.
CouchbaseAsyncCluster cluster =
CouchbaseAsyncCluster.create("localhost");
cluster.authenticate("Administrator", "password");
rx.Observable<AsyncBucket> bucket;
cluster.openBucket("wrongName")
.doOnError(e -> System.out.println("error occurred"))
.doOnNext(openbucket -> System.out.println("bucket opened"))
.subscribe(openBucket -> System.out.println("subscription
complete"));
System.out.println("done...");
The above code does not generate any error and no entry in log either. What is the best way to capture the error opening a bucket?