Uploaded image for project: 'Couchbase .NET client library'
  1. Couchbase .NET client library
  2. NCBC-1522

Cluster class: when requesting a Query and bucket is not authenticate -> wrong exception

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Minor
    • 2.5.1
    • 2.5.0
    • library
    • .net visual studio 2017

    Description

      if you run that code:

       

       

      // var config = new ClientConfiguration()
      {
      Servers = new List<Uri> {
      <snip>
      },
       
       
      };
      Cluster cluster = new Cluster(config);
       
      var cred = new ClassicAuthenticator("Administrator","password");
      //cred.AddBucketCredential("buck", "");
      //cred.AddBucketCredential("travel-sample", "");
       
       
      cluster.Authenticate(cred);
       
      var qr = new QueryRequest().Statement("select * from buck;").Metrics(true);
      var result = cluster.Query<dynamic>(qr);
      

      and do not have the "AddBucketCredential" - query will fail with "Sequence has no elements" instead of an exception which is more informative like "Can't issue query, bucket is not authenticate" or something similar.

      Link:

      https://github.com/couchbase/couchbase-net-client/blob/master/Src/Couchbase/Cluster.cs#L270

       

       

       

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            jmorris Jeff Morris
            roi.katz Roi Katz
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty